TypeScript/tests/cases/compiler/superPropertyAccess2.ts

27 lines
455 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
class C {
public static foo() { }
public get x() {
return 1;
}
public static bar() { }
}
class D extends C {
public static foo() {
super.bar(); // OK
super.x; // error
}
constructor() {
super();
super.bar(); // error
super.x; // error
}
public static get y() {
super.bar(); // OK
super.x; // error
return 1;
}
}