0062デフォルトの名無しさん
2015/10/24(土) 14:26:29.93ID:otxAXsrhclass Base {
getThis(): Base { return this; }
}
class Derived extends Base {
print(): void { console.log('Derived'); }
}
let derived = new Derived();
derived.getThis().print(); // 1.6.2だとBaseにprint()がねーよと怒られる
1.7だと
getThis(): this { return this; }
にする事でコンパイル通ってちゃんと実行も出来る
って事は理解したけど、equals(other: this)のthisって自分の型名のエイリアス
として使えるから便利って事であってるの?