Skip to content

Proposal: Remove Partial Application of Non-Final Super Methods #43

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 1 commit into from
Dec 12, 2015
Merged

Proposal: Remove Partial Application of Non-Final Super Methods #43

merged 1 commit into from
Dec 12, 2015

Conversation

bitjammer
Copy link
Contributor

This simplifies the implementation for dynamic super method dispatch and should have a small impact. I've sent out the rough idea to the mailing list and will link here.

@lattner
Copy link
Collaborator

lattner commented Dec 11, 2015

I commented on the list, but I'll reproduce it here for archival:

" Currying will be removed in Swift 3.0 so, rather than invest more engineering in those mechanisms, I propose that we disallow partial application of non-final methods through super, except where the self parameter is implicitly captured.”

This isn’t true. The proposal you’re referring to removes the “func f(a : Int)(b : Int)” syntax, but methods will still be curried. It will still be perfectly legal to do:

class Foo {
func bar() {}
}

let fn = Foo.bar
fn()

So, I think that in a perfect world, the implementation would lazily generate curry thunks for super partial applications, and we would keep the current behavior. However, if it is a significant implementation burden, I’d support doing a survey of existing code to see how widely used this is. I suspect it is rare, and if you can prove this, we may be able to knowingly break compatibility in this case in the service of getting the ABI stability.

DougGregor added a commit that referenced this pull request Dec 12, 2015
Proposal: Remove Partial Application of Non-Final Super Methods
@DougGregor DougGregor merged commit baeb987 into swiftlang:master Dec 12, 2015
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.

None yet

4 participants