Last active
October 8, 2018 15:26
-
-
Save vialyx/8761606a8851b148a40f8080c1be7c93 to your computer and use it in GitHub Desktop.
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
struct Car { | |
let vin: String | |
var number: String? | |
} | |
var newCar = Car(vin: "ZNA123051252OK", number: nil) | |
newCar.number = "4440PX7" | |
// Error, vin is constant | |
// newCar.vin = "" | |
let car = newCar | |
// Error, car is constant of value type | |
// car.number = "0000MI7" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment