-
Notifications
You must be signed in to change notification settings - Fork 15
Delegate
Eric Yang edited this page Jun 27, 2021
·
1 revision
将一个子字段field的成员都委托到当前层级。
type Animal (
weight: i32
)
type Person (
age: i32,
name: string,
as animal: Animal // delegate
)
let p: Person = new Person();
p.weight // p.animal.weight