1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
=== tests/cases/compiler/typeofProperty.ts ===
interface I1 {
>I1 : Symbol(I1, Decl(typeofProperty.ts, 0, 0))
a: number;
>a : Symbol(I1.a, Decl(typeofProperty.ts, 0, 14))
b: typeof a; // Should yield error (a is not a value)
>b : Symbol(I1.b, Decl(typeofProperty.ts, 1, 14))
}
interface I2 {
>I2 : Symbol(I2, Decl(typeofProperty.ts, 3, 1))
c: typeof d; // Should yield error (d is not a value)
>c : Symbol(I2.c, Decl(typeofProperty.ts, 5, 14))
d: string;
>d : Symbol(I2.d, Decl(typeofProperty.ts, 6, 16))
}
interface I3 {
>I3 : Symbol(I3, Decl(typeofProperty.ts, 8, 1))
e: typeof e; // Should yield error (e is not a value)
>e : Symbol(I3.e, Decl(typeofProperty.ts, 10, 14))
}
class C1 {
>C1 : Symbol(C1, Decl(typeofProperty.ts, 12, 1))
a: number;
>a : Symbol(C1.a, Decl(typeofProperty.ts, 14, 10))
b: typeof a; // Should yield error (a is not a value)
>b : Symbol(C1.b, Decl(typeofProperty.ts, 15, 14))
}
class C2 {
>C2 : Symbol(C2, Decl(typeofProperty.ts, 17, 1))
c: typeof d; // Should yield error (d is not a value)
>c : Symbol(C2.c, Decl(typeofProperty.ts, 20, 10))
d: string;
>d : Symbol(C2.d, Decl(typeofProperty.ts, 21, 16))
}
class C3 {
>C3 : Symbol(C3, Decl(typeofProperty.ts, 23, 1))
e: typeof e; // Should yield error (e is not a value)
>e : Symbol(C3.e, Decl(typeofProperty.ts, 25, 10))
}
interface ValidInterface {
>ValidInterface : Symbol(ValidInterface, Decl(typeofProperty.ts, 27, 1))
x: string;
>x : Symbol(ValidInterface.x, Decl(typeofProperty.ts, 31, 26))
}
class ValidClass implements ValidInterface {
>ValidClass : Symbol(ValidClass, Decl(typeofProperty.ts, 33, 1))
>ValidInterface : Symbol(ValidInterface, Decl(typeofProperty.ts, 27, 1))
x: string;
>x : Symbol(ValidClass.x, Decl(typeofProperty.ts, 35, 44))
}
var vcInstance = new ValidClass();
>vcInstance : Symbol(vcInstance, Decl(typeofProperty.ts, 39, 3))
>ValidClass : Symbol(ValidClass, Decl(typeofProperty.ts, 33, 1))
var viInstance = vcInstance;
>viInstance : Symbol(viInstance, Decl(typeofProperty.ts, 40, 3))
>vcInstance : Symbol(vcInstance, Decl(typeofProperty.ts, 39, 3))
var x1: typeof vcInstance.x; // x1: string
>x1 : Symbol(x1, Decl(typeofProperty.ts, 42, 3))
>vcInstance.x : Symbol(ValidClass.x, Decl(typeofProperty.ts, 35, 44))
>vcInstance : Symbol(vcInstance, Decl(typeofProperty.ts, 39, 3))
>x : Symbol(ValidClass.x, Decl(typeofProperty.ts, 35, 44))
var x2: typeof viInstance.x; // x2: string
>x2 : Symbol(x2, Decl(typeofProperty.ts, 43, 3))
>viInstance.x : Symbol(ValidClass.x, Decl(typeofProperty.ts, 35, 44))
>viInstance : Symbol(viInstance, Decl(typeofProperty.ts, 40, 3))
>x : Symbol(ValidClass.x, Decl(typeofProperty.ts, 35, 44))
|