Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用我的 64 位 Mac(Macbook Pro 2009),Xcode 游乐场中的这段代码表现得很奇怪:
let var1 = UInt32.max // 4,294,967,295 let var2 = UInt64.max // -1 --> why? var var3: UInt = UInt.max // -1 --> why? var3 = -1 // generates an error.
设置var3为-1应该会产生错误。但在声明行中,它变为等于-1。
var3
-1
显然,这只是 swift playground 中的一个错误,根据@Anton 的说法,打印变量显示正确的值。