Skip to content

Commit 14b59b2

Browse files
author
Yui T
committed
Address PR
1 parent ced8cf8 commit 14b59b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/compiler/declarationEmitter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ namespace ts {
341341
}
342342
else {
343343
errorNameNode = signature.name;
344-
resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer);
344+
resolver.writeReturnTypeOfSignatureDeclaration(signature, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
345345
errorNameNode = undefined;
346346
}
347347
}
@@ -563,7 +563,7 @@ namespace ts {
563563
write(tempVarName);
564564
write(": ");
565565
writer.getSymbolAccessibilityDiagnostic = getDefaultExportAccessibilityDiagnostic;
566-
resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer);
566+
resolver.writeTypeOfExpression(node.expression, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
567567
write(";");
568568
writeLine();
569569
write(node.isExportEquals ? "export = " : "export default ");
@@ -1025,7 +1025,7 @@ namespace ts {
10251025
}
10261026
else {
10271027
writer.getSymbolAccessibilityDiagnostic = getHeritageClauseVisibilityError;
1028-
resolver.writeBaseConstructorTypeOfClass(<ClassLikeDeclaration>enclosingDeclaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction, writer);
1028+
resolver.writeBaseConstructorTypeOfClass(<ClassLikeDeclaration>enclosingDeclaration, enclosingDeclaration, TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue, writer);
10291029
}
10301030

10311031
function getHeritageClauseVisibilityError(symbolAccessibilityResult: SymbolAccessibilityResult): SymbolAccessibilityDiagnostic {

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ namespace ts {
19461946
UseFullyQualifiedType = 0x00000080, // Write out the fully qualified type name (eg. Module.Type, instead of Type)
19471947
InFirstTypeArgument = 0x00000100, // Writing first type argument of the instantiated type
19481948
InTypeAlias = 0x00000200, // Writing type in type alias declaration
1949-
UseTypeAliasValue = 0x00000400, // Writing infered type alias as its value. This is used when we emit declaration file
1949+
UseTypeAliasValue = 0x00000400, // Serialize the type instead of using type-alias. This is needed when we emit declaration file.
19501950
}
19511951

19521952
export const enum SymbolFormatFlags {

0 commit comments

Comments
 (0)