Skip to content

Sema: Look through inout when mapping IUOs to Optionals. #13680

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

Merged
merged 3 commits into from
Jan 3, 2018
Merged

Sema: Look through inout when mapping IUOs to Optionals. #13680

merged 3 commits into from
Jan 3, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jan 2, 2018

We translate IUOs to Optionals when generating signatures, but were
failing to look through inout in the process, so we were allowing
functions to be overloaded by Optional vs. IUO when the parameter was
inout.

Fixes https://bugs.swift.org/browse/SR-6685 / rdar://problem/36255630.

We translate IUOs to Optionals when generating signatures, but were
failing to look through inout in the process, so we were allowing
functions to be overloaded by Optional vs. IUO when the parameter was
inout.

Fixes https://bugs.swift.org/browse/SR-6685 / rdar://problem/36255630.
@rudkx rudkx requested a review from DougGregor January 2, 2018 20:43
@rudkx
Copy link
Contributor Author

rudkx commented Jan 2, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 2, 2018

@swift-ci Please test source compatibility

@jrose-apple
Copy link
Contributor

I'm very unhappy with breaking source in this way, even if 97% of the time simply deleting the IUO overload is the right thing to do.

@rudkx
Copy link
Contributor Author

rudkx commented Jan 2, 2018

Discussion happening here: https://bugs.swift.org/browse/SR-6690

@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

As expected there's a failure on ObjectMapper in the source compatibility suite due to this change.

Rather than error for overloading by the kind of optional (T? vs. T!)
for inout parameters, just emit a warning for now and continue
compiling.

We'll need to turn this back into an error when we remove IUOs from
the type system.
@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please test source compatibility

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please test source compatibility

Also add a note saying that allowing these overloads is deprecated and
will be removed in a future release.
@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please test source compatibility

1 similar comment
@rudkx
Copy link
Contributor Author

rudkx commented Jan 3, 2018

@swift-ci Please test source compatibility

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

Successfully merging this pull request may close these issues.

2 participants