Created
January 24, 2017 05:51
-
-
Save ukitaka/ffb823cf54196efd54f1d5d241172456 to your computer and use it in GitHub Desktop.
Tuple has same named label
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
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