You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
class Animal { kind: string } class Dog extends Animal { dog_type: string } function showDogType(dog: Dog) { console.log(dog.dog_type) } // 代入不可のコンパイルエラーになってほしい const someAnimalFunc: (animal: Animal) => void = showDogType // 実際はここでランタイムエラー someAnimalFunc(new Animal()) このコードがコンパイルエラーにならず, 実行時エラーになってしまうことについて. TL;DR 型システムの健全性 (型の矛盾が生じないこと) vs 利便性のトレードオフから, 現在の TypeScript は健全性を諦めている 関数型はパラメータについて biv
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く