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

Support type inference for named constructors #1224

Closed
jvasileff opened this issue Feb 7, 2015 · 3 comments
Closed

Support type inference for named constructors #1224

jvasileff opened this issue Feb 7, 2015 · 3 comments
Assignees
Milestone

Comments

@jvasileff
Copy link
Member

For example:

shared class Box<Element> {
    shared new Of(Element e) {}
}

Box<String> bs = Box.Of("");
// Missing type arguments to generic declaration:
//  Box declares type parameters Element
@gavinking gavinking added this to the 1.2 milestone Feb 10, 2015
@gavinking gavinking self-assigned this Feb 10, 2015
gavinking added a commit that referenced this issue Mar 4, 2015
@gavinking
Copy link
Member

I have implemented this on a branch. It was most natural to also support inference for qualifying types in static method references, for example, List.get([1,2,3])(0).

But that means I still have to really think this through and see if I can poke holes in it.

@gavinking
Copy link
Member

OK, so this is now fully implemented, and the branch merged. I'm leaving the issue open for now, because this needs to be documented in the spec.

@gavinking
Copy link
Member

Spec done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants