Created
November 15, 2017 12:42
-
-
Save takasek/45f12376876eed10dfc235dfc9c38f1c to your computer and use it in GitHub Desktop.
さっきの挙動びっくりした気がしたけど、やってることはこれと同じか。そっか。 #CodePiece
This file contains 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 { | |
struct B { | |
var i: Int | |
} | |
var b: B | |
var xxx: B { | |
get { return b } | |
set { b = newValue } | |
} | |
} | |
var a = A(b: .init(i: 1)) | |
a.xxx.i = 2 | |
a.b.i // 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment