[過去ログ]
TypeScript part2 [転載禁止]©2ch.net (1002レス)
TypeScript part2 [転載禁止]©2ch.net http://mevius.5ch.net/test/read.cgi/tech/1430386649/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
62: デフォルトの名無しさん [sage] 2015/10/24(土) 14:26:29 ID:otxAXsrh >>59 class 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って自分の型名のエイリアス として使えるから便利って事であってるの? http://mevius.5ch.net/test/read.cgi/tech/1430386649/62
63: デフォルトの名無しさん [sage] 2015/10/24(土) 14:31:41 ID:otxAXsrh >>60 Emacsと https://github.com/ananthakumaran/tide ↑を使う事でVSに劣らないインテリセンス環境が出来上がるぞ(ページ内のscreencastを見るべし!) ちなみに常用してるけどMac版Emacsは使った事ないから詳細は分からん http://mevius.5ch.net/test/read.cgi/tech/1430386649/63
64: デフォルトの名無しさん [sage] 2015/10/24(土) 14:48:22 ID:otxAXsrh >>59 class Base { equals(other: this): boolean { return other.name === "Derived"; } } class Derived extends Base { name = "Derived"; } let derived = new Derived(); console.log(derived.equals(derived)); だと、1.7でも(正確には1.7.0-dev.20151016) test.ts(3,18): error TS2339: Property 'name' does not exist on type 'Base'. って、ポリモらないけど…なんでなん? http://mevius.5ch.net/test/read.cgi/tech/1430386649/64
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.164s*