"Cannot assign null to non-nullable" for array of optionals


(Jon Nermut) #1

The following is valid swift (works as expected in the XCode playground):

print("The magic happens here.")
var arr1 = Array<String?>()
arr1.append("some string")
arr1.append(nil)
print(arr1)
let arr2: Array<String?> = ["hello", nil]
print(arr2)

However fails to compile in Fire 2321:

consoleapplication227.zip (5.8 KB)


(RemObjects) #2

Thanks, logged as bugs://80922


(RemObjects) #3

bugs://80922 got closed with status fixed.


(Jon Nermut) #4

Thanks