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

dart2js: Combination of generic function invocation and Function types not implemented #31572

eernstg opened this Issue Dec 7, 2017 · 1 comment


3 participants

eernstg commented Dec 7, 2017

With dart2js (from e299963, 2.0.0-dev.7.0, and probably all versions this year), the following program claims a syntax error:

main() => print(f<String Function(int)>(null));

This syntax is allowed (the actual argument to print is an invocation of a generic function where the actual type argument is a Function type). Here's the report:

Error: Expected ')' before this.
main() => print(f<String Function(int)>(null));
Error: Compilation failed.

The problem also exists when invoked as dart2js --use-kernel ...

One known part of the problem is that isValidMethodTypeArguments in 'parser.dart' hasn't been updated to take the new style Function types into account, and in particular tryParseType expects only the syntax we had before those types were added. Other parts of the parser may also be unprepared for this kind of syntax once isValidMethodTypeArguments is updated such that an attempt will be made to parse a generic function invocation.


This comment has been minimized.

Show comment
Hide comment

sigmundch Jun 26, 2018


this seems to now be handled correctly by the CFE


sigmundch commented Jun 26, 2018

this seems to now be handled correctly by the CFE

@sigmundch sigmundch closed this Jun 26, 2018

@kmillikin kmillikin moved this from Incoming Untriaged to Done in Dart Front End Aug 1, 2018

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