TypeScript/tests/baselines/reference/staticPropertyNotInClassType.symbols
Anders Hejlsberg a4f9bf0fce
Create type aliases for unresolved type symbols (#45976)
* Create type aliases for unresolved type symbols

* Accept new baselines

* Update fourslash tests

* Unresolved import aliases create tagged unresolved symbols

* Add comments

* Accept new baselines

* Add fourslash tests
2021-09-23 13:21:27 -07:00

116 lines
4.9 KiB
Plaintext

=== tests/cases/conformance/classes/members/classTypes/staticPropertyNotInClassType.ts ===
module NonGeneric {
>NonGeneric : Symbol(NonGeneric, Decl(staticPropertyNotInClassType.ts, 0, 0))
class C {
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 0, 19), Decl(staticPropertyNotInClassType.ts, 7, 5))
fn() { return this; }
>fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 1, 13))
>this : Symbol(C, Decl(staticPropertyNotInClassType.ts, 0, 19), Decl(staticPropertyNotInClassType.ts, 7, 5))
static get x() { return 1; }
>x : Symbol(C.x, Decl(staticPropertyNotInClassType.ts, 2, 29), Decl(staticPropertyNotInClassType.ts, 3, 36))
static set x(v) { }
>x : Symbol(C.x, Decl(staticPropertyNotInClassType.ts, 2, 29), Decl(staticPropertyNotInClassType.ts, 3, 36))
>v : Symbol(v, Decl(staticPropertyNotInClassType.ts, 4, 21))
constructor(public a: number, private b: number) { }
>a : Symbol(C.a, Decl(staticPropertyNotInClassType.ts, 5, 20))
>b : Symbol(C.b, Decl(staticPropertyNotInClassType.ts, 5, 37))
static foo: string; // not reflected in class type
>foo : Symbol(C.foo, Decl(staticPropertyNotInClassType.ts, 5, 60))
}
module C {
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 0, 19), Decl(staticPropertyNotInClassType.ts, 7, 5))
export var bar = ''; // not reflected in class type
>bar : Symbol(bar, Decl(staticPropertyNotInClassType.ts, 10, 18))
}
var c = new C(1, 2);
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 13, 7))
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 0, 19), Decl(staticPropertyNotInClassType.ts, 7, 5))
var r = c.fn();
>r : Symbol(r, Decl(staticPropertyNotInClassType.ts, 14, 7))
>c.fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 1, 13))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 13, 7))
>fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 1, 13))
var r4 = c.foo; // error
>r4 : Symbol(r4, Decl(staticPropertyNotInClassType.ts, 15, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 13, 7))
var r5 = c.bar; // error
>r5 : Symbol(r5, Decl(staticPropertyNotInClassType.ts, 16, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 13, 7))
var r6 = c.x; // error
>r6 : Symbol(r6, Decl(staticPropertyNotInClassType.ts, 17, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 13, 7))
}
module Generic {
>Generic : Symbol(Generic, Decl(staticPropertyNotInClassType.ts, 18, 1))
class C<T, U> {
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 20, 16), Decl(staticPropertyNotInClassType.ts, 27, 5))
>T : Symbol(T, Decl(staticPropertyNotInClassType.ts, 21, 12))
>U : Symbol(U, Decl(staticPropertyNotInClassType.ts, 21, 14))
fn() { return this; }
>fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 21, 19))
>this : Symbol(C, Decl(staticPropertyNotInClassType.ts, 20, 16), Decl(staticPropertyNotInClassType.ts, 27, 5))
static get x() { return 1; }
>x : Symbol(C.x, Decl(staticPropertyNotInClassType.ts, 22, 29), Decl(staticPropertyNotInClassType.ts, 23, 36))
static set x(v) { }
>x : Symbol(C.x, Decl(staticPropertyNotInClassType.ts, 22, 29), Decl(staticPropertyNotInClassType.ts, 23, 36))
>v : Symbol(v, Decl(staticPropertyNotInClassType.ts, 24, 21))
constructor(public a: T, private b: U) { }
>a : Symbol(C.a, Decl(staticPropertyNotInClassType.ts, 25, 20))
>T : Symbol(T, Decl(staticPropertyNotInClassType.ts, 21, 12))
>b : Symbol(C.b, Decl(staticPropertyNotInClassType.ts, 25, 32))
>U : Symbol(U, Decl(staticPropertyNotInClassType.ts, 21, 14))
static foo: T; // not reflected in class type
>foo : Symbol(C.foo, Decl(staticPropertyNotInClassType.ts, 25, 50))
>T : Symbol(T)
}
module C {
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 20, 16), Decl(staticPropertyNotInClassType.ts, 27, 5))
export var bar = ''; // not reflected in class type
>bar : Symbol(bar, Decl(staticPropertyNotInClassType.ts, 30, 18))
}
var c = new C(1, '');
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 33, 7))
>C : Symbol(C, Decl(staticPropertyNotInClassType.ts, 20, 16), Decl(staticPropertyNotInClassType.ts, 27, 5))
var r = c.fn();
>r : Symbol(r, Decl(staticPropertyNotInClassType.ts, 34, 7))
>c.fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 21, 19))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 33, 7))
>fn : Symbol(C.fn, Decl(staticPropertyNotInClassType.ts, 21, 19))
var r4 = c.foo; // error
>r4 : Symbol(r4, Decl(staticPropertyNotInClassType.ts, 35, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 33, 7))
var r5 = c.bar; // error
>r5 : Symbol(r5, Decl(staticPropertyNotInClassType.ts, 36, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 33, 7))
var r6 = c.x; // error
>r6 : Symbol(r6, Decl(staticPropertyNotInClassType.ts, 37, 7))
>c : Symbol(c, Decl(staticPropertyNotInClassType.ts, 33, 7))
}