[過去ログ] TypeScript part2 [転載禁止]©2ch.net (1002レス)
上下前次1-新
抽出解除 必死チェッカー(本家) (べ) レス栞 あぼーん
このスレッドは過去ログ倉庫に格納されています。
次スレ検索 歴削→次スレ 栞削→次スレ 過去ログメニュー
61(1): デフォルトの名無しさん [sage] 2015/10/24(土) 11:24:42 ID:lLID1QIl(1/2) AAS
>>6060(2): デフォルトの名無しさん [sage] 2015/10/23(金) 23:33:29 ID:oFKlQBDH(1) AAS
typescriptで使いやすいEditorでおすすめってなんですかね?
MS由来からいってVSなんでしょうけど、当方Macなので、、、、
外部リンク:github.com
普段何使ってるんだよ
Vimは導入が難しいが、何するにしても特化した環境が作れるぞ
66(1): デフォルトの名無しさん [sage] 2015/10/24(土) 17:46:56 ID:lLID1QIl(2/2) AAS
>>6464(3): デフォルトの名無しさん [sage] 2015/10/24(土) 14:48:22 ID:otxAXsrh(3/3) AAS
>>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'.
って、ポリモらないけど…なんでなん?
そういった使い方は無いと思うよ。その場合はジェネリックを使うといい
class Base {
equals<T extends { name: string; }>(other: T): boolean { return other.name === "Derived"; }
}
上下前次1-新書関写板覧索設栞歴
スレ情報 赤レス抽出 画像レス抽出 歴の未読スレ AAサムネイル
ぬこの手 ぬこTOP 0.171s*