mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
988 B
Plaintext
24 lines
988 B
Plaintext
classSideInheritance1.ts(12,3): error TS2576: Property 'bar' does not exist on type 'A'. Did you mean to access the static member 'A.bar' instead?
|
|
classSideInheritance1.ts(13,3): error TS2576: Property 'bar' does not exist on type 'C2'. Did you mean to access the static member 'C2.bar' instead?
|
|
|
|
|
|
==== classSideInheritance1.ts (2 errors) ====
|
|
class A {
|
|
static bar(): string {
|
|
return "";
|
|
}
|
|
foo(): number { return 1; }
|
|
}
|
|
|
|
class C2 extends A {}
|
|
|
|
declare var a: A;
|
|
declare var c: C2;
|
|
a.bar(); // static off an instance - should be an error
|
|
~~~
|
|
!!! error TS2576: Property 'bar' does not exist on type 'A'. Did you mean to access the static member 'A.bar' instead?
|
|
c.bar(); // static off an instance - should be an error
|
|
~~~
|
|
!!! error TS2576: Property 'bar' does not exist on type 'C2'. Did you mean to access the static member 'C2.bar' instead?
|
|
A.bar(); // valid
|
|
C2.bar(); // valid |