Well I understand the concept of optionals and the nil value and how swift wants to keep your code safe from errors
Swift is great at inferring variables
. But why doesn't the swift compiler accept just a declared variable.
That's to say, Why would
let unInitializedVariable: Int
throw an error or not allowed yet if I say
let unInitializedVariable: Int? = nil
then the compiler is happy. Would It be meaningless If say the compiler inferred the first statement to be the same as the later expression? Can someone please explain.