105 lines
5.2 KiB
Plaintext
105 lines
5.2 KiB
Plaintext
=== tests/cases/conformance/types/typeParameters/typeParameterLists/propertyAccessOnTypeParameterWithoutConstraints.ts ===
|
|
class C<T> {
|
|
>C : Symbol(C, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 0))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 8))
|
|
|
|
f() {
|
|
>f : Symbol(f, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 12))
|
|
|
|
var x: T;
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 2, 11))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 8))
|
|
|
|
var a = x['toString'](); // should be string
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 3, 11))
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 2, 11))
|
|
>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
|
|
return a + x.toString();
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 3, 11))
|
|
>x.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 2, 11))
|
|
>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
}
|
|
}
|
|
|
|
var r = (new C<number>()).f();
|
|
>r : Symbol(r, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 8, 3))
|
|
>(new C<number>()).f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 12))
|
|
>C : Symbol(C, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 0))
|
|
>f : Symbol(C.f, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 0, 12))
|
|
|
|
interface I<T> {
|
|
>I : Symbol(I, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 8, 30))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 12))
|
|
|
|
foo: T;
|
|
>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 16))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 12))
|
|
}
|
|
var i: I<number>;
|
|
>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 13, 3))
|
|
>I : Symbol(I, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 8, 30))
|
|
|
|
var r2 = i.foo.toString();
|
|
>r2 : Symbol(r2, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 14, 3))
|
|
>i.foo.toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
|
>i.foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 16))
|
|
>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 13, 3))
|
|
>foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 16))
|
|
>toString : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
|
|
|
var r2b = i.foo['toString']();
|
|
>r2b : Symbol(r2b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 15, 3))
|
|
>i.foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 16))
|
|
>i : Symbol(i, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 13, 3))
|
|
>foo : Symbol(I.foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 10, 16))
|
|
>'toString' : Symbol(Number.toString, Decl(lib.d.ts, 458, 18))
|
|
|
|
var a: {
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3))
|
|
|
|
<T>(): T;
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 18, 5))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 18, 5))
|
|
}
|
|
var r3: string = a().toString();
|
|
>r3 : Symbol(r3, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 20, 3))
|
|
>a().toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3))
|
|
>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
|
|
var r3b: string = a()['toString']();
|
|
>r3b : Symbol(r3b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 21, 3))
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 17, 3))
|
|
>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
|
|
var b = {
|
|
>b : Symbol(b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 3))
|
|
|
|
foo: <T>(x: T) => {
|
|
>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 9))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 24, 10))
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 24, 13))
|
|
>T : Symbol(T, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 24, 10))
|
|
|
|
var a = x['toString'](); // should be string
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 25, 11))
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 24, 13))
|
|
>'toString' : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
|
|
return a + x.toString();
|
|
>a : Symbol(a, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 25, 11))
|
|
>x.toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
>x : Symbol(x, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 24, 13))
|
|
>toString : Symbol(Object.toString, Decl(lib.d.ts, 96, 26))
|
|
}
|
|
}
|
|
|
|
var r4 = b.foo(1);
|
|
>r4 : Symbol(r4, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 30, 3))
|
|
>b.foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 9))
|
|
>b : Symbol(b, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 3))
|
|
>foo : Symbol(foo, Decl(propertyAccessOnTypeParameterWithoutConstraints.ts, 23, 9))
|
|
|