Skip to content
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

Change function/closure coercions to polymorphism #18599

Closed
nrc opened this issue Nov 4, 2014 · 5 comments
Closed

Change function/closure coercions to polymorphism #18599

nrc opened this issue Nov 4, 2014 · 5 comments

Comments

@nrc
Copy link
Member

nrc commented Nov 4, 2014

See RFC 401.

In particular: the Function type polymorphism section.

Part of #18469

@nikomatsakis
Copy link
Contributor

We could probably live without doing this, but it would mean that unboxed closures have an extra virtual call indirection.

@nikomatsakis
Copy link
Contributor

Various incompatibilities I can think of off the top of my head that would be introduced:

if cond { some_fn } else { some_other_fn } // <-- two distinct types now

The case of if could be worked around by having special rules regarding the typing of if.

let mut x = some_fn;
x = some_other_fn:

This case would be harder without special-casing how inference works as well.

@pnkfelix
Copy link
Member

pnkfelix commented Nov 6, 2014

Assigning P-backcompat-lang since it believed that there are some incompatibilities associated with this. But it is also not believed to be the end of the world if we do not get around to it, because there are some ideas floating around about how to address the biggest issues in a backwards-compatible fashion. (See @nikomatsakis for more details there.)

Thus, P-backcompat-lang, but not 1.0.

@nrc
Copy link
Member Author

nrc commented Dec 19, 2014

This is addressed by PR #19891 (which hasn't landed yet)

@nrc
Copy link
Member Author

nrc commented Jan 5, 2015

Closed by #19891

@nrc nrc closed this as completed Jan 5, 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

No branches or pull requests

3 participants