mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
If a var has optional type, e.g. ``` var x: Int? ``` It will be implicitly initialized to `nil`. However, there's a second, undocumented behavior: tuples of optional type, potentially nested infinitely, will also be initialized, to tuples of nil. So this var ``` var w: ((Int?, (), Int?), (Int?, Int?)) ``` Will be default-initialized to ``` ((nil, (), nil), (nil, nil)) ``` We need to handle this inside getDefaultValueStringRepresentation, otherwise we will crash while emitting partial modules. Fixes one instance of rdar://51560190
4.7 KiB
4.7 KiB