Skip to content

Commit 2bf4bad

Browse files
committed
Revert incorrect logic from #11392
1 parent adfa271 commit 2bf4bad

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2229,14 +2229,8 @@ namespace ts {
22292229
// The specified symbol flags need to be reinterpreted as type flags
22302230
buildSymbolDisplay(type.symbol, writer, enclosingDeclaration, SymbolFlags.Type, SymbolFormatFlags.None, nextFlags);
22312231
}
2232-
else if (!(flags & TypeFormatFlags.InTypeAlias) && ((getObjectFlags(type) & ObjectFlags.Anonymous && !(<AnonymousType>type).target) || type.flags & TypeFlags.UnionOrIntersection) && type.aliasSymbol &&
2232+
else if (!(flags & TypeFormatFlags.InTypeAlias) && (getObjectFlags(type) & ObjectFlags.Anonymous || type.flags & TypeFlags.UnionOrIntersection) && type.aliasSymbol &&
22332233
isSymbolAccessible(type.aliasSymbol, enclosingDeclaration, SymbolFlags.Type, /*shouldComputeAliasesToMakeVisible*/ false).accessibility === SymbolAccessibility.Accessible) {
2234-
// We emit inferred type as type-alias at the current localtion if all the following is true
2235-
// the input type is has alias symbol that is accessible
2236-
// the input type is a union, intersection or anonymous type that is fully instantiated (if not we want to keep dive into)
2237-
// e.g.: export type Bar<X, Y> = () => [X, Y];
2238-
// export type Foo<Y> = Bar<any, Y>;
2239-
// export const y = (x: Foo<string>) => 1 // we want to emit as ...x: () => [any, string])
22402234
const typeArguments = type.aliasTypeArguments;
22412235
writeSymbolTypeReference(type.aliasSymbol, typeArguments, 0, typeArguments ? typeArguments.length : 0, nextFlags);
22422236
}

0 commit comments

Comments
 (0)