TypeScript/tests/baselines/reference/errorElaboration.symbols
rChaser53 d75de60548 Fix Cannot read property 'text' of undefined crash (#32734)
* Fix Cannot read property 'text' of undefined crash

* fix condition for tsx

* Rename and improve the method
2019-08-19 12:08:34 -07:00

64 lines
2.1 KiB
Plaintext

=== tests/cases/compiler/errorElaboration.ts ===
// Repro for #5712
interface Ref<T> {
>Ref : Symbol(Ref, Decl(errorElaboration.ts, 0, 0))
>T : Symbol(T, Decl(errorElaboration.ts, 2, 14))
prop: T;
>prop : Symbol(Ref.prop, Decl(errorElaboration.ts, 2, 18))
>T : Symbol(T, Decl(errorElaboration.ts, 2, 14))
}
interface Container<T> {
>Container : Symbol(Container, Decl(errorElaboration.ts, 4, 1))
>T : Symbol(T, Decl(errorElaboration.ts, 5, 20))
m1: Container<Ref<T>>;
>m1 : Symbol(Container.m1, Decl(errorElaboration.ts, 5, 24))
>Container : Symbol(Container, Decl(errorElaboration.ts, 4, 1))
>Ref : Symbol(Ref, Decl(errorElaboration.ts, 0, 0))
>T : Symbol(T, Decl(errorElaboration.ts, 5, 20))
m2: T;
>m2 : Symbol(Container.m2, Decl(errorElaboration.ts, 6, 26))
>T : Symbol(T, Decl(errorElaboration.ts, 5, 20))
}
declare function foo(x: () => Container<Ref<number>>): void;
>foo : Symbol(foo, Decl(errorElaboration.ts, 8, 1))
>x : Symbol(x, Decl(errorElaboration.ts, 9, 21))
>Container : Symbol(Container, Decl(errorElaboration.ts, 4, 1))
>Ref : Symbol(Ref, Decl(errorElaboration.ts, 0, 0))
let a: () => Container<Ref<string>>;
>a : Symbol(a, Decl(errorElaboration.ts, 10, 3))
>Container : Symbol(Container, Decl(errorElaboration.ts, 4, 1))
>Ref : Symbol(Ref, Decl(errorElaboration.ts, 0, 0))
foo(a);
>foo : Symbol(foo, Decl(errorElaboration.ts, 8, 1))
>a : Symbol(a, Decl(errorElaboration.ts, 10, 3))
// Repro for #25498
function test(): {[A in "foo"]: A} {
>test : Symbol(test, Decl(errorElaboration.ts, 11, 7))
>A : Symbol(A, Decl(errorElaboration.ts, 15, 19))
>A : Symbol(A, Decl(errorElaboration.ts, 15, 19))
return {foo: "bar"};
>foo : Symbol(foo, Decl(errorElaboration.ts, 16, 10))
}
// Repro for #32358
const foo = { bar: 'a' };
>foo : Symbol(foo, Decl(errorElaboration.ts, 21, 5))
>bar : Symbol(bar, Decl(errorElaboration.ts, 21, 13))
const x = ({ [foo.bar]: c }) => undefined;
>x : Symbol(x, Decl(errorElaboration.ts, 22, 5))
>foo : Symbol(foo, Decl(errorElaboration.ts, 8, 1))
>c : Symbol(c, Decl(errorElaboration.ts, 22, 12))
>undefined : Symbol(undefined)