mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
44 lines
1.4 KiB
Plaintext
44 lines
1.4 KiB
Plaintext
//// [tests/cases/compiler/classSideInheritance1.ts] ////
|
|
|
|
=== 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))
|
|
|
|
declare var a: A;
|
|
>a : Symbol(a, Decl(classSideInheritance1.ts, 9, 11))
|
|
>A : Symbol(A, Decl(classSideInheritance1.ts, 0, 0))
|
|
|
|
declare var c: C2;
|
|
>c : Symbol(c, Decl(classSideInheritance1.ts, 10, 11))
|
|
>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, 11))
|
|
|
|
c.bar(); // static off an instance - should be an error
|
|
>c : Symbol(c, Decl(classSideInheritance1.ts, 10, 11))
|
|
|
|
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))
|
|
|