I'm just starting Swift, and using a book (Swift for Programmers) that has this example code in it:

let number1 = 45
let number2 = 72
let sum = number1 + number2
...

But this gives me an error on the third line, saying "Consecutive statements on a line must be separated by a ';'."

I know I could use a var instead of a constant, initialize it to number1 and then add number2 separately, but shouldn't the above code be legal? Is this something that changed in Swift since that book came out? (I am using the new beta build of Xcode 6.3, which I think has an updated Swift version.)

Thanks,
  Howard
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to