このようなコードを使用する提案がありました
class A {
// Setting this to private will cause class B to have a compile error
public x: string = 'a';
}
class B extends A {
constructor(){super();}
method():string {
return super.x;
}
}
var b:B = new B();
alert(b.method());
しかも9票も獲得。しかし、公式の TS プレイグラウンド http://www.typescriptlang.org/Playground/ に貼り付けると、エラーが発生します。
BからAのxプロパティにアクセスするには?