Skip to content

Commit 2daed90

Browse files
committed
TSExternsGenerator: fix missing imports for abstract underlying types with type parameters
1 parent bff3eba commit 2daed90

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scripts/TSExternsGenerator.hx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,17 @@ class TSExternsGenerator {
724724
for (param in params) {
725725
addMacroTypeQnamesForImport(param, qnames, pack);
726726
}
727+
var abstractType = t.get();
728+
switch (abstractType.type) {
729+
case TAbstract(t, underlyingParams):
730+
var result = baseTypeToQname(abstractType, params, false);
731+
var compareTo = baseTypeToQname(t.get(), underlyingParams, false);
732+
if (result != compareTo) {
733+
addMacroTypeQnamesForImport(abstractType.type, qnames, pack);
734+
}
735+
default:
736+
addMacroTypeQnamesForImport(abstractType.type, qnames, pack);
737+
}
727738
break;
728739
case TType(t, params):
729740
var typedefType = t.get();

0 commit comments

Comments
 (0)