mzgreen
07/21/2017, 1:40 PMlet foo: Int = a?.b.value
then it shows an error which makes sense, but if I let it infer the type then it works and if I set a
to nil
then foo
is null which would suggest that it’s actually an Int?
but IDE shows me Int
.
I guess it’s an IDE bug.
let a: A? = A()
let foo = a?.b.value
foo is Int // prints true for Int and for Int?
but
let a: A? = nil
let foo = a?.b.value
foo is Int? // prints true only for Int?