TypeScript/tests/cases/compiler/classSideInheritance1.ts

15 lines
299 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
class A {
static bar(): string {
return "";
}
foo(): number { return 1; }
}
class C2 extends A {}
var a: A;
var c: C2;
a.bar(); // static off an instance - should be an error
c.bar(); // static off an instance - should be an error
A.bar(); // valid
C2.bar(); // valid