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 generic method syntax in dart2js #25835

Closed
eernstg opened this issue Feb 22, 2016 · 3 comments
Closed

Support generic method syntax in dart2js #25835

eernstg opened this issue Feb 22, 2016 · 3 comments

Comments

@eernstg
Copy link
Member

eernstg commented Feb 22, 2016

The dart2js compiler should support declaration of type parameters in function and method declarations, and it should support provision of type arguments in message sends. The type parameter declaration grammar should be identical to the grammar of type parameter declarations on classes, and the type argument grammar should be identical to the grammar of type arguments passed to constructors on new expressions.

@eernstg
Copy link
Member Author

eernstg commented Feb 22, 2016

https://codereview.chromium.org/1723443003/ provides support for this, when the flag '--enable-generic-methods' is specified. Missing: The specified type parameters are ignored and hence all usages of the type parameters will cause an 'unknown type' warning or possibly a different warning because the same name is declared also in an enclosing scope and the usage is incorrect for that declaration.

@eernstg
Copy link
Member Author

eernstg commented May 2, 2016

https://codereview.chromium.org/1942763002/ adds support (still behind a flag as mentioned, but it has been renamed to '--generic-method-syntax') for passing method/function type variables into the resolution phase, and making them appear to be the type dynamic. This means that a wide range of usages of the type parameters are now accepted silently (but not type checked: bounds are ignored).

@eernstg
Copy link
Member Author

eernstg commented Feb 6, 2017

As of 9bf3b95 (Nov 22, 2016), the generic method syntax feature is enabled by default. The option --generic-method-syntax is still accepted, but has no effect.

@eernstg eernstg closed this as completed Feb 6, 2017
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