Skip to content

Instantly share code, notes, and snippets.

@ukitaka
Created January 24, 2017 05:51
Show Gist options
  • Save ukitaka/ffb823cf54196efd54f1d5d241172456 to your computer and use it in GitHub Desktop.
Save ukitaka/ffb823cf54196efd54f1d5d241172456 to your computer and use it in GitHub Desktop.
Tuple has same named label
typealias MyTuple = (hoge: Int, hoge: String) // 同じ名前のラベルが置ける
let myTuple = MyTuple(hoge: 1, hoge: "Hello")
print(myTuple.hoge) // 1
func stringFunc(text: String) { }
// NG: 型推論はできない
// stringFunc(text: myTuple.hoge)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment