Skip to content

Instantly share code, notes, and snippets.

@kssreeram
Created June 23, 2016 04:51
Show Gist options
  • Save kssreeram/f6c583dc2a011b0f5354190c6cd9a0e6 to your computer and use it in GitHub Desktop.
Save kssreeram/f6c583dc2a011b0f5354190c6cd9a0e6 to your computer and use it in GitHub Desktop.
Swift "inout" crasher
func testAlias(inout a:(Int, Int), inout _ b:Int) {
print((a, b));
}
var v = (10, 20);
testAlias(&v, &v.0);
@slavapestov
Copy link

Looks like this does the trick:

let x = (a, b)
print(x)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment