Created
June 23, 2016 04:51
-
-
Save kssreeram/f6c583dc2a011b0f5354190c6cd9a0e6 to your computer and use it in GitHub Desktop.
Swift "inout" crasher
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
func testAlias(inout a:(Int, Int), inout _ b:Int) { | |
print((a, b)); | |
} | |
var v = (10, 20); | |
testAlias(&v, &v.0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like this does the trick:
let x = (a, b)
print(x)