-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Revert "[SR-12033] [Sema] Do not allow inferring defaultable closure () -> $T
for autoclosure arguments result"
#36022
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
Conversation
…`() -> $T` for autoclosure arguments result"
@swift-ci please smoke test |
@swift-ci please smoke test Windows platform |
@swift-ci please smoke test Linux platform |
1 similar comment
@swift-ci please smoke test Linux platform |
hum, ok sorry for that and thank you for reverting :)) |
@LucianoPAlmeida No worries! The fix is correct since otherwise the behavior is not obvious to users it's just the source compatibility impact :/ Could you please open a PR to avoid transitive inference of |
That's unfortunate... do you think its possible to fix this without source compatibility break?
For sure :) |
I don't think so since there are projects which rely on this behavior. What we can do though is to rank solutions with func test<T>(_: () -> T) {}
func test<T>(_: @autoclosure () -> T) {}
test { } This example is ambiguous today but it shouldn't be. |
That makes sense! |
We might, it might be worth a search before creating a new one. |
Right, I'll look it up. Thanks! |
SR-2705 is what we want here. |
Reverts #35503
@LucianoPAlmeida Unfortunately we have to revert this for now and make it more tailored since these changes caused a source compatibility regression in code like this: