-4

I want to declare an array in a Swift Playground, but doing it this way

var lengths: [Int] = []

produces a Consecutive statements on a line must be separated by ';' error. However, declaring the array this other way, works perfectly

var lengths: Int[] = []

I'm running Xcode 6-beta build version 6A215l.

amb
  • 4,798
  • 6
  • 41
  • 68

2 Answers2

1

The syntax of Arrays was changed in Beta 3. Your first line gives me that error in the first beta. If you upgrade to the newest beta it should work.

Connor Pearson
  • 63,902
  • 28
  • 145
  • 142
1

You are running a beta version of Xcode that is over a month old. Download the newest version.

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287