Skip to content

Instantly share code, notes, and snippets.

@takasek
Created November 15, 2017 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takasek/45f12376876eed10dfc235dfc9c38f1c to your computer and use it in GitHub Desktop.
Save takasek/45f12376876eed10dfc235dfc9c38f1c to your computer and use it in GitHub Desktop.
さっきの挙動びっくりした気がしたけど、やってることはこれと同じか。そっか。 #CodePiece
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