Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional Keys crash Xcode 16 #177

Open
ConfusedVorlon opened this issue Jun 11, 2024 · 6 comments
Open

Optional Keys crash Xcode 16 #177

ConfusedVorlon opened this issue Jun 11, 2024 · 6 comments

Comments

@ConfusedVorlon
Copy link

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...

@ConfusedVorlon
Copy link
Author

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

@sindresorhus
Copy link
Owner

I recommend reporting this to Apple. It looks like a Swift bug.

@hank121314
Copy link
Collaborator

It seems to be the same as this issue: swiftlang/swift#74282

@sindresorhus
Copy link
Owner

You could use this workaround for now: 5434b04

It works as long as you don't use AnySerializable.

@ConfusedVorlon
Copy link
Author

Brilliant - thank you.

@ConfusedVorlon
Copy link
Author

fyi - not fixed on beta 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants