@@ -2297,7 +2297,6 @@ namespace ts {
2297
2297
InFirstTypeArgument: boolean; // Writing first type argument of the instantiated type
2298
2298
// TODO: ???
2299
2299
InTypeAlias: boolean; // Writing type in type alias declaration
2300
- checkAlias: boolean;
2301
2300
symbolStack: Symbol[] | undefined;
2302
2301
}
2303
2302
@@ -2310,7 +2309,6 @@ namespace ts {
2310
2309
InElementType: false,
2311
2310
InFirstTypeArgument: false,
2312
2311
InTypeAlias: false,
2313
- checkAlias: true,
2314
2312
symbolStack: undefined
2315
2313
};
2316
2314
}
@@ -2319,6 +2317,8 @@ namespace ts {
2319
2317
const InElementType = context.InElementType;
2320
2318
// TODO: why doesn't tts unset the flag?
2321
2319
context.InElementType = false;
2320
+ const inTypeAlias = context.InTypeAlias;
2321
+ context.InTypeAlias = false;
2322
2322
2323
2323
// TODO: should be assert?
2324
2324
if (!type) {
@@ -2406,12 +2406,11 @@ namespace ts {
2406
2406
return createTypeReferenceNode(name, /*typeArguments*/ undefined);
2407
2407
}
2408
2408
2409
- if (!context.InTypeAlias && context.checkAlias && type.aliasSymbol) {
2409
+ if (!inTypeAlias && type.aliasSymbol) {
2410
2410
const name = symbolToName(type.aliasSymbol, /*expectsIdentifier*/ false, context);
2411
2411
const typeArgumentNodes = type.aliasTypeArguments && mapToTypeNodeArray(type.aliasTypeArguments, /*addInElementTypeFlag*/ false);
2412
2412
return createTypeReferenceNode(name, typeArgumentNodes);
2413
2413
}
2414
- context.checkAlias = false;
2415
2414
2416
2415
if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) {
2417
2416
const types = type.flags & TypeFlags.Union ? formatUnionTypes((<UnionType>type).types) : (<IntersectionType>type).types;
0 commit comments