Optional Keys crash Xcode 16
ConfusedVorlon opened this issue · 7 comments
It seems that optional keys are not caught by
if (defaultValue as? _DefaultsOptionalProtocol)?._defaults_isNil == true {
return
}
The good news is that this is caught in the tests...
XCode 15.4 defines ExpressibleByNilLiteral
Conforming Types
[Optional]
XCode 16 states:
[Optional]
Conforms when Wrapped conforms to Escapable.
meanwhile, Escapable seems to have no requirements, but not to be available without
-enable-experimental-feature NonescapableTypes
If I do enable that feature, then compilation fails with a circular reference as soon as I include a key
I recommend reporting this to Apple. It looks like a Swift bug.
It seems to be the same as this issue: swiftlang/swift#74282
You could use this workaround for now: 5434b04
It works as long as you don't use AnySerializable
.
Brilliant - thank you.
fyi - not fixed on beta 2
Fixed in Beta 3 :)