Last active
February 11, 2017 09:04
-
-
Save wm3/2db9b78f9112917e1c3fa909abf11cf5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct A { var v: Int } | |
struct B { | |
var _a = A(v: 0) | |
var a: A { | |
get { print("get \(_a)"); return _a } | |
set(a) { print("set \(a)"); _a = a } | |
} | |
} | |
var b = B() | |
b.a.v = 3 | |
// Output | |
// ---------------- | |
// get A(v: 0) | |
// set A(v: 3) | |
// get A(v: 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment