我只是尝试了一下快捷的新功能Overriding Property Observers
class B {
var c:Int = 3 {
didSet {
c = 5
}
}
}
class C: B {
override var c:Int = 9 {
didSet {
c = 10
}
}
}
但会引发编译错误:
Playground execution failed: super.init called
multiple times in initializerinteger overflows
when converted from 'Builtin.Int32' to 'Builtin.Int8'