-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
Sema: Look through inout when mapping IUOs to Optionals. #13680
Conversation
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.
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
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. |
Discussion happening here: https://bugs.swift.org/browse/SR-6690 |
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.
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@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.
@swift-ci Please smoke test |
@swift-ci Please test source compatibility |
1 similar comment
@swift-ci Please test source compatibility |
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.