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
|
=== tests/cases/compiler/classSideInheritance1.ts ===
class A {
>A : Symbol(A, Decl(classSideInheritance1.ts, 0, 0))
static bar(): string {
>bar : Symbol(A.bar, Decl(classSideInheritance1.ts, 0, 9))
return "";
}
foo(): number { return 1; }
>foo : Symbol(A.foo, Decl(classSideInheritance1.ts, 3, 5))
}
class C2 extends A {}
>C2 : Symbol(C2, Decl(classSideInheritance1.ts, 5, 1))
>A : Symbol(A, Decl(classSideInheritance1.ts, 0, 0))
var a: A;
>a : Symbol(a, Decl(classSideInheritance1.ts, 9, 3))
>A : Symbol(A, Decl(classSideInheritance1.ts, 0, 0))
var c: C2;
>c : Symbol(c, Decl(classSideInheritance1.ts, 10, 3))
>C2 : Symbol(C2, Decl(classSideInheritance1.ts, 5, 1))
a.bar(); // static off an instance - should be an error
>a : Symbol(a, Decl(classSideInheritance1.ts, 9, 3))
c.bar(); // static off an instance - should be an error
>c : Symbol(c, Decl(classSideInheritance1.ts, 10, 3))
A.bar(); // valid
>A.bar : Symbol(A.bar, Decl(classSideInheritance1.ts, 0, 9))
>A : Symbol(A, Decl(classSideInheritance1.ts, 0, 0))
>bar : Symbol(A.bar, Decl(classSideInheritance1.ts, 0, 9))
C2.bar(); // valid
>C2.bar : Symbol(A.bar, Decl(classSideInheritance1.ts, 0, 9))
>C2 : Symbol(C2, Decl(classSideInheritance1.ts, 5, 1))
>bar : Symbol(A.bar, Decl(classSideInheritance1.ts, 0, 9))
|