But it is an uninitialized optional

Also tuples of optionals... which includes empty tuples:

var foo: ()
print(foo)

I pitched removing this 6 years ago (Pitch: Remove default initialization of optional bindings) but there wasn't a lot of interest in proceeding. While perhaps it's not the best language feature, at this point it would be too disruptive to remove it, and it doesn't have any serious consequences from the viewpoint of code readability or implementation complexity. And as they say, these funny quirks give each programming language its unique texture and flavor and bring joy into our lives.

9 Likes