Skip to content

Arguably improve declaration emit in two ways: #48491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4370,6 +4370,9 @@ namespace ts {
return [symbol!];
}
}
if (symbolFromSymbolTable.flags & SymbolFlags.TypeAlias && isAccessible(symbolFromSymbolTable, getDeclaredTypeOfTypeAlias(symbolFromSymbolTable).symbol)) {
return [symbolFromSymbolTable];
}
});

// If there's no result and we're looking at the global symbol table, treat `globalThis` like an alias and try to lookup thru that
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
=== tests/cases/compiler/DeclarationErrorsNoEmitOnError.ts ===
type T = { x : number }
>T : Symbol(T, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 0))
>x : Symbol(x, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 10))
>x : Symbol(T.x, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 10))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I saw 100+ baselines changed, I thought I had done something horribly wrong, but... this seems like an improvement?


export interface I {
>I : Symbol(I, Decl(DeclarationErrorsNoEmitOnError.ts, 0, 23))
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/accessorBodyInTypeContext.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ type A = {
>A : Symbol(A, Decl(accessorBodyInTypeContext.ts, 0, 0))

get foo() { return 0 }
>foo : Symbol(foo, Decl(accessorBodyInTypeContext.ts, 0, 10))
>foo : Symbol(A.foo, Decl(accessorBodyInTypeContext.ts, 0, 10))

};

type B = {
>B : Symbol(B, Decl(accessorBodyInTypeContext.ts, 2, 2))

set foo(v: any) { }
>foo : Symbol(foo, Decl(accessorBodyInTypeContext.ts, 4, 10))
>foo : Symbol(B.foo, Decl(accessorBodyInTypeContext.ts, 4, 10))
>v : Symbol(v, Decl(accessorBodyInTypeContext.ts, 5, 12))

};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export var a = vextend({
>val : Symbol(val, Decl(app.js, 4, 10))

this.data2 = 1;
>this : Symbol(__type, Decl(lib.es5.d.ts, --, --))
>this : Symbol(Record, Decl(lib.es5.d.ts, --, --))
>data2 : Symbol(data2, Decl(app.js, 4, 16), Decl(app.js, 6, 6))

},
Expand Down
6 changes: 3 additions & 3 deletions tests/baselines/reference/argumentsAsPropertyName.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type MyType = {
>MyType : Symbol(MyType, Decl(argumentsAsPropertyName.ts, 0, 0))

arguments: Array<string>
>arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>arguments : Symbol(MyType.arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
}

Expand All @@ -24,9 +24,9 @@ function myFunction(myType: MyType) {

use(myType.arguments[i]);
>use : Symbol(use, Decl(argumentsAsPropertyName.ts, 3, 1))
>myType.arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>myType.arguments : Symbol(MyType.arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>myType : Symbol(myType, Decl(argumentsAsPropertyName.ts, 7, 20))
>arguments : Symbol(arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>arguments : Symbol(MyType.arguments, Decl(argumentsAsPropertyName.ts, 1, 15))
>i : Symbol(i, Decl(argumentsAsPropertyName.ts, 8, 12))

// create closure so that tsc will turn loop body into function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace Example1 {

type S = { done: boolean, value: number };
>S : Symbol(S, Decl(assignmentCompatWithDiscriminatedUnion.ts, 3, 20))
>done : Symbol(done, Decl(assignmentCompatWithDiscriminatedUnion.ts, 4, 14))
>value : Symbol(value, Decl(assignmentCompatWithDiscriminatedUnion.ts, 4, 29))
>done : Symbol(S.done, Decl(assignmentCompatWithDiscriminatedUnion.ts, 4, 14))
>value : Symbol(S.value, Decl(assignmentCompatWithDiscriminatedUnion.ts, 4, 29))

type T =
>T : Symbol(T, Decl(assignmentCompatWithDiscriminatedUnion.ts, 4, 46))
Expand Down Expand Up @@ -42,8 +42,8 @@ namespace Example2 {

type S = { a: 0 | 2, b: 4 };
>S : Symbol(S, Decl(assignmentCompatWithDiscriminatedUnion.ts, 18, 20))
>a : Symbol(a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 19, 14))
>b : Symbol(b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 19, 24))
>a : Symbol(S.a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 19, 14))
>b : Symbol(S.b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 19, 24))

type T = { a: 0, b: 1 | 4 } // T0
>T : Symbol(T, Decl(assignmentCompatWithDiscriminatedUnion.ts, 19, 32))
Expand Down Expand Up @@ -79,8 +79,8 @@ namespace Example3 {

type S = { a: 0 | 2, b: 4 };
>S : Symbol(S, Decl(assignmentCompatWithDiscriminatedUnion.ts, 32, 20))
>a : Symbol(a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 33, 14))
>b : Symbol(b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 33, 24))
>a : Symbol(S.a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 33, 14))
>b : Symbol(S.b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 33, 24))

type T = { a: 0, b: 1 | 4 } // T0
>T : Symbol(T, Decl(assignmentCompatWithDiscriminatedUnion.ts, 33, 32))
Expand Down Expand Up @@ -117,8 +117,8 @@ namespace Example4 {

type S = { a: 0 | 2, b: 4 };
>S : Symbol(S, Decl(assignmentCompatWithDiscriminatedUnion.ts, 47, 20))
>a : Symbol(a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 48, 14))
>b : Symbol(b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 48, 24))
>a : Symbol(S.a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 48, 14))
>b : Symbol(S.b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 48, 24))

type T = { a: 0, b: 1 | 4 } // T0
>T : Symbol(T, Decl(assignmentCompatWithDiscriminatedUnion.ts, 48, 32))
Expand Down Expand Up @@ -161,11 +161,11 @@ namespace Example5 {

type S = { a: N, b: N, c: N };
>S : Symbol(S, Decl(assignmentCompatWithDiscriminatedUnion.ts, 65, 23))
>a : Symbol(a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 14))
>a : Symbol(S.a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 14))
>N : Symbol(N, Decl(assignmentCompatWithDiscriminatedUnion.ts, 61, 20))
>b : Symbol(b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 20))
>b : Symbol(S.b, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 20))
>N : Symbol(N, Decl(assignmentCompatWithDiscriminatedUnion.ts, 61, 20))
>c : Symbol(c, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 26))
>c : Symbol(S.c, Decl(assignmentCompatWithDiscriminatedUnion.ts, 66, 26))
>N : Symbol(N, Decl(assignmentCompatWithDiscriminatedUnion.ts, 61, 20))

type T = { a: 0, b: N, c: N }
Expand Down Expand Up @@ -273,10 +273,10 @@ namespace GH14865 {
>Style2 : Symbol(Style2, Decl(assignmentCompatWithDiscriminatedUnion.ts, 92, 6))

type: "A" | "B";
>type : Symbol(type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))
>type : Symbol(Style2.type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))

data: string;
>data : Symbol(data, Decl(assignmentCompatWithDiscriminatedUnion.ts, 95, 24))
>data : Symbol(Style2.data, Decl(assignmentCompatWithDiscriminatedUnion.ts, 95, 24))
}

const a: Style2 = { type: "A", data: "whatevs" };
Expand All @@ -290,9 +290,9 @@ namespace GH14865 {
>Style1 : Symbol(Style1, Decl(assignmentCompatWithDiscriminatedUnion.ts, 85, 19))

a.type; // "A" | "B"
>a.type : Symbol(type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))
>a.type : Symbol(Style2.type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))
>a : Symbol(a, Decl(assignmentCompatWithDiscriminatedUnion.ts, 99, 9))
>type : Symbol(type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))
>type : Symbol(Style2.type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 94, 19))

b.type; // "A" | "B"
>b.type : Symbol(type, Decl(assignmentCompatWithDiscriminatedUnion.ts, 86, 19), Decl(assignmentCompatWithDiscriminatedUnion.ts, 89, 9))
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/awaitedType.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type T4 = Awaited<number | Promise<string>>;
type T5 = Awaited<{ then: number }>;
>T5 : Symbol(T5, Decl(awaitedType.ts, 3, 44))
>Awaited : Symbol(Awaited, Decl(lib.es5.d.ts, --, --))
>then : Symbol(then, Decl(awaitedType.ts, 4, 19))
>then : Symbol(T5.then, Decl(awaitedType.ts, 4, 19))

type T6 = Awaited<{ then(): void }>; // never (non-promise "thenable")
>T6 : Symbol(T6, Decl(awaitedType.ts, 4, 36))
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/awaitedTypeStrictNull.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type T4 = Awaited<number | Promise<string>>;
type T5 = Awaited<{ then: number }>;
>T5 : Symbol(T5, Decl(awaitedTypeStrictNull.ts, 3, 44))
>Awaited : Symbol(Awaited, Decl(lib.es5.d.ts, --, --))
>then : Symbol(then, Decl(awaitedTypeStrictNull.ts, 4, 19))
>then : Symbol(T5.then, Decl(awaitedTypeStrictNull.ts, 4, 19))

type T6 = Awaited<{ then(): void }>; // never (non-promise "thenable")
>T6 : Symbol(T6, Decl(awaitedTypeStrictNull.ts, 4, 36))
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/callWithSpread4.symbols
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
=== tests/cases/conformance/expressions/functionCalls/callWithSpread4.ts ===
type R = { a: number }
>R : Symbol(R, Decl(callWithSpread4.ts, 0, 0))
>a : Symbol(a, Decl(callWithSpread4.ts, 0, 10))
>a : Symbol(R.a, Decl(callWithSpread4.ts, 0, 10))

type W = { b: number }
>W : Symbol(W, Decl(callWithSpread4.ts, 0, 22))
>b : Symbol(b, Decl(callWithSpread4.ts, 1, 10))
>b : Symbol(W.b, Decl(callWithSpread4.ts, 1, 10))

type RW = { a: number, b: number }
>RW : Symbol(RW, Decl(callWithSpread4.ts, 1, 22))
>a : Symbol(a, Decl(callWithSpread4.ts, 2, 11))
>b : Symbol(b, Decl(callWithSpread4.ts, 2, 22))
>a : Symbol(RW.a, Decl(callWithSpread4.ts, 2, 11))
>b : Symbol(RW.b, Decl(callWithSpread4.ts, 2, 22))

declare const pli: {
>pli : Symbol(pli, Decl(callWithSpread4.ts, 3, 13))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type TypeA = {
>TypeA : Symbol(TypeA, Decl(type-a.ts, 0, 0))

a: string;
>a : Symbol(a, Decl(type-a.ts, 0, 21))
>a : Symbol(TypeA.a, Decl(type-a.ts, 0, 21))
}
=== tests/cases/compiler/Uppercased_Dir/src/types.ts ===
export type Merge<T, U> = T & U;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export = Foo;

module.exports = /** @type {FooFun} */(void 0);
>module.exports = /** @type {FooFun} */(void 0) : (foo: Foo) => string
>module.exports : (foo: typeof import("tests/cases/compiler/file")) => string
>module : { exports: (foo: typeof import("tests/cases/compiler/file")) => string; }
>exports : (foo: typeof import("tests/cases/compiler/file")) => string
>module.exports : (foo: typeof Foo) => string
>module : { exports: (foo: typeof Foo) => string; }
>exports : (foo: typeof Foo) => string
>(void 0) : FooFun
>void 0 : undefined
>0 : 0
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/checkJsdocTypeTag4.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
type A<T extends string> = { a: T }
>A : Symbol(A, Decl(t.d.ts, 0, 0))
>T : Symbol(T, Decl(t.d.ts, 0, 7))
>a : Symbol(a, Decl(t.d.ts, 0, 28))
>a : Symbol(A.a, Decl(t.d.ts, 0, 28))
>T : Symbol(T, Decl(t.d.ts, 0, 7))

=== tests/cases/conformance/jsdoc/test.js ===
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/checkJsdocTypedefInParamTag1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ function foo(opts) {
>opts : Symbol(opts, Decl(0.js, 10, 13))

opts.x;
>opts.x : Symbol(x, Decl(0.js, 3, 3))
>opts.x : Symbol(Opts.x, Decl(0.js, 3, 3))
>opts : Symbol(opts, Decl(0.js, 10, 13))
>x : Symbol(x, Decl(0.js, 3, 3))
>x : Symbol(Opts.x, Decl(0.js, 3, 3))
}

foo({x: 'abc'});
Expand All @@ -35,9 +35,9 @@ function foo1(opts) {
>opts : Symbol(opts, Decl(0.js, 23, 14))

opts.anotherX;
>opts.anotherX : Symbol(anotherX, Decl(0.js, 18, 3))
>opts.anotherX : Symbol(AnotherOpts.anotherX, Decl(0.js, 18, 3))
>opts : Symbol(opts, Decl(0.js, 23, 14))
>anotherX : Symbol(anotherX, Decl(0.js, 18, 3))
>anotherX : Symbol(AnotherOpts.anotherX, Decl(0.js, 18, 3))
}

foo1({anotherX: "world"});
Expand All @@ -58,9 +58,9 @@ function foo2(opts) {
>opts : Symbol(opts, Decl(0.js, 38, 14))

opts.x;
>opts.x : Symbol(x, Decl(0.js, 31, 3))
>opts.x : Symbol(Opts1.x, Decl(0.js, 31, 3))
>opts : Symbol(opts, Decl(0.js, 38, 14))
>x : Symbol(x, Decl(0.js, 31, 3))
>x : Symbol(Opts1.x, Decl(0.js, 31, 3))
}
foo2({x: 'abc'});
>foo2 : Symbol(foo2, Decl(0.js, 27, 26))
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/checkerInitializationCrash.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare global {
export import VNode = react.ReactNode;
>VNode : Symbol(FullCalendarVDom.VNode, Decl(index.d.ts, 2, 30))
>react : Symbol(react, Decl(index.d.ts, 0, 6))
>ReactNode : Symbol(react.ReactNode, Decl(index.d.ts, 2, 25), Decl(index.d.ts, 2, 30))
>ReactNode : Symbol(ReactNode, Decl(index.d.ts, 2, 25), Decl(index.d.ts, 2, 30))
}
}

Expand All @@ -30,7 +30,7 @@ declare global {
>FullCalendarVDom : Symbol(FullCalendarVDom, Decl(index.d.ts, 1, 16), Decl(index.d.ts, 1, 16))

type VNode = preact.VNode<any>;
>VNode : Symbol(React.ReactNode, Decl(index.d.ts, 2, 25), Decl(index.d.ts, 2, 30))
>VNode : Symbol(ReactNode, Decl(index.d.ts, 2, 25), Decl(index.d.ts, 2, 30))
>preact : Symbol(preact, Decl(index.d.ts, 0, 6))
>VNode : Symbol(preact.VNode, Decl(index.d.ts, 0, 27))
}
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/circularAccessorAnnotations.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ type T1 = {
>T1 : Symbol(T1, Decl(circularAccessorAnnotations.ts, 11, 1))

get foo(): T1["foo"];
>foo : Symbol(foo, Decl(circularAccessorAnnotations.ts, 13, 11))
>foo : Symbol(T1.foo, Decl(circularAccessorAnnotations.ts, 13, 11))
>T1 : Symbol(T1, Decl(circularAccessorAnnotations.ts, 11, 1))
}

type T2 = {
>T2 : Symbol(T2, Decl(circularAccessorAnnotations.ts, 15, 1))

set foo(value: T2["foo"]);
>foo : Symbol(foo, Decl(circularAccessorAnnotations.ts, 17, 11))
>foo : Symbol(T2.foo, Decl(circularAccessorAnnotations.ts, 17, 11))
>value : Symbol(value, Decl(circularAccessorAnnotations.ts, 18, 12))
>T2 : Symbol(T2, Decl(circularAccessorAnnotations.ts, 15, 1))
}
Expand All @@ -55,10 +55,10 @@ type T3 = {
>T3 : Symbol(T3, Decl(circularAccessorAnnotations.ts, 19, 1))

get foo(): string;
>foo : Symbol(foo, Decl(circularAccessorAnnotations.ts, 21, 11), Decl(circularAccessorAnnotations.ts, 22, 22))
>foo : Symbol(T3.foo, Decl(circularAccessorAnnotations.ts, 21, 11), Decl(circularAccessorAnnotations.ts, 22, 22))

set foo(value: T3["foo"]);
>foo : Symbol(foo, Decl(circularAccessorAnnotations.ts, 21, 11), Decl(circularAccessorAnnotations.ts, 22, 22))
>foo : Symbol(T3.foo, Decl(circularAccessorAnnotations.ts, 21, 11), Decl(circularAccessorAnnotations.ts, 22, 22))
>value : Symbol(value, Decl(circularAccessorAnnotations.ts, 23, 12))
>T3 : Symbol(T3, Decl(circularAccessorAnnotations.ts, 19, 1))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/circularBaseTypes.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
type M<T> = { value: T };
>M : Symbol(M, Decl(circularBaseTypes.ts, 0, 0))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))
>value : Symbol(value, Decl(circularBaseTypes.ts, 2, 13))
>value : Symbol(M.value, Decl(circularBaseTypes.ts, 2, 13))
>T : Symbol(T, Decl(circularBaseTypes.ts, 2, 7))

interface M2 extends M<M3> {}; // Error
Expand Down
10 changes: 5 additions & 5 deletions tests/baselines/reference/circularIndexedAccessErrors.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type T1 = {
>T1 : Symbol(T1, Decl(circularIndexedAccessErrors.ts, 0, 0))

x: T1["x"]; // Error
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 0, 11))
>x : Symbol(T1.x, Decl(circularIndexedAccessErrors.ts, 0, 11))
>T1 : Symbol(T1, Decl(circularIndexedAccessErrors.ts, 0, 0))

};
Expand All @@ -13,13 +13,13 @@ type T2<K extends "x" | "y"> = {
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))

x: T2<K>[K]; // Error
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>x : Symbol(T2.x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>T2 : Symbol(T2, Decl(circularIndexedAccessErrors.ts, 2, 2))
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))
>K : Symbol(K, Decl(circularIndexedAccessErrors.ts, 4, 8))

y: number;
>y : Symbol(y, Decl(circularIndexedAccessErrors.ts, 5, 16))
>y : Symbol(T2.y, Decl(circularIndexedAccessErrors.ts, 5, 16))
}

declare let x2: T2<"x">;
Expand All @@ -28,9 +28,9 @@ declare let x2: T2<"x">;

let x2x = x2.x;
>x2x : Symbol(x2x, Decl(circularIndexedAccessErrors.ts, 10, 3))
>x2.x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>x2.x : Symbol(T2.x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>x2 : Symbol(x2, Decl(circularIndexedAccessErrors.ts, 9, 11))
>x : Symbol(x, Decl(circularIndexedAccessErrors.ts, 4, 32))
>x : Symbol(T2.x, Decl(circularIndexedAccessErrors.ts, 4, 32))

interface T3<T extends T3<T>> {
>T3 : Symbol(T3, Decl(circularIndexedAccessErrors.ts, 10, 15))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
=== tests/cases/compiler/coAndContraVariantInferences.ts ===
type A = { kind: 'a' };
>A : Symbol(A, Decl(coAndContraVariantInferences.ts, 0, 0))
>kind : Symbol(kind, Decl(coAndContraVariantInferences.ts, 0, 10))
>kind : Symbol(A.kind, Decl(coAndContraVariantInferences.ts, 0, 10))

type B = { kind: 'b' };
>B : Symbol(B, Decl(coAndContraVariantInferences.ts, 0, 23))
>kind : Symbol(kind, Decl(coAndContraVariantInferences.ts, 1, 10))
>kind : Symbol(B.kind, Decl(coAndContraVariantInferences.ts, 1, 10))

declare const a: A;
>a : Symbol(a, Decl(coAndContraVariantInferences.ts, 3, 13))
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/computedPropertyName.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type T = {
>T : Symbol(T, Decl(component.ts, 4, 1))

[onInit]: any;
>[onInit] : Symbol([onInit], Decl(component.ts, 6, 10))
>[onInit] : Symbol(T[onInit], Decl(component.ts, 6, 10))
>onInit : Symbol(onInit, Decl(component.ts, 0, 13))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ type IndexObject = { [key: string]: unknown; };

type FooBar = { foo: "hello"; bar: "world"; };
>FooBar : Symbol(FooBar, Decl(computedTypesKeyofNoIndexSignatureType.ts, 11, 47))
>foo : Symbol(foo, Decl(computedTypesKeyofNoIndexSignatureType.ts, 12, 15))
>bar : Symbol(bar, Decl(computedTypesKeyofNoIndexSignatureType.ts, 12, 29))
>foo : Symbol(FooBar.foo, Decl(computedTypesKeyofNoIndexSignatureType.ts, 12, 15))
>bar : Symbol(FooBar.bar, Decl(computedTypesKeyofNoIndexSignatureType.ts, 12, 29))

type WithIndex = Compute<FooBar & IndexObject>; // { [x: string]: {}; foo: "hello"; bar: "world"; } <-- OK
>WithIndex : Symbol(WithIndex, Decl(computedTypesKeyofNoIndexSignatureType.ts, 12, 46))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function testAssignabilityToConditionalType<T>() {
type Wrapped<T> = { ___secret: T };
>Wrapped : Symbol(Wrapped, Decl(conditionalTypeAssignabilityWhenDeferred.ts, 79, 1))
>T : Symbol(T, Decl(conditionalTypeAssignabilityWhenDeferred.ts, 81, 13))
>___secret : Symbol(___secret, Decl(conditionalTypeAssignabilityWhenDeferred.ts, 81, 19))
>___secret : Symbol(Wrapped.___secret, Decl(conditionalTypeAssignabilityWhenDeferred.ts, 81, 19))
>T : Symbol(T, Decl(conditionalTypeAssignabilityWhenDeferred.ts, 81, 13))

type Unwrap<T> = T extends Wrapped<infer U> ? U : T;
Expand Down
Loading