0
type aliasセクションの公式文書の例です。私はそれが次のエラーを生成します。この例を試すときタイプエイリアスの打ち文字タイプの交差
type LinkedList<T> = T & { next: LinkedList<T> };
interface Person {
name: string;
}
var people: LinkedList<Person>;
var s = people.name;
//var s = people.next.name;
//var s = people.next.next.name;
//var s = people.next.next.next.name;
:
TypeError: Cannot read property 'name' of undefined
人はLINKLISTタイプがあります。人々のリンクリストを正しく埋めるには?