Avatar
@swift-main struct Stone { var x: Int { get { return 1 } _modify { var xx: Int = 3 print("before yield \(xx)") yield &xx print("after yield \(xx)") y = xx } } var y: Int = 0 } func mod(_ x: inout Int) { print("before modify") x = 8 print("after modify") } func main() { var a = Stone() mod(&a.x) print(a.y) } main()