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
[SR-1051] Implement SE-0042 - Flattening the function type of unapplied method references #43663
Comments
Comment by Janek Spaderna (JIRA) |
@jckarter or @slavapestov, does this bug need to be added to the ABI Dashboard? |
It doesn't affect ABI, it's only a source-level behavior change. |
This change would not affect ABI, but it does clearly have source compatibility impact so if we ever implement this proposal it would need to be staged in with a -swift-version flag. However I think at this point it would have to go through review again and it would be unlikely to be accepted without changes. One option is to deprecate the old unapplied method reference syntax, and instead use keypath syntax, for example \Foo.bar, which would have the new type. |
Thanks, there was a suggestion to retool thunks to have the new uncurried type by default, so I thought it might affect ABI. |
Those kinds of thunks generally have private linkage, since they can be generated at will by any module that needs them. |
What's the status on this? Has it been abandoned? |
@slavapestov even though this is super old, the idea going the key-path way seems good, but in some cases it is not possible because key-paths require hashability, which means that function parameter types and the result type also would need to be hashable. |
Key path literals don't need to be constrained to hashability in function context. Functions aren't hashable. |
Ah, then you are saying that the key path literal will be transformed into a closure just like the recently accepted proposal? Otherwise I‘m not sure I follow. |
> Ah, then you are saying that the key path literal will be transformed into a closure just like the recently accepted proposal? Yes, that would be the idea. We should also transform unapplied method references to closures too, and remove all the SILGen support for "curry thunks". |
Additional Detail from JIRA
md5: c0489b3d664c0051f324983f13c46c29
Issue Description:
SE-0042 has been accepted:
https://github.com/apple/swift-evolution/blob/master/proposals/0042-flatten-method-types.md
We need an implementation now!
The text was updated successfully, but these errors were encountered: