class Test { var value: Int init(_ value: Int) { self.value = value } deinit { print("deinit") } } do { var x: Test = Test(0) { didSet { print("did set \(x)") } } x = Test(1) print("exit do") } print("End")