-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[cfe] Instantiated function tearoff does have Object
methods
#46887
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
Comments
The same situation seems to exist in co19/LanguageFeatures/Constructor-tear-offs/ambiguities_A08_t03.dart. |
Same situation in co19/LanguageFeatures/Constructor-tear-offs/ambiguities_A13_t03.dart. |
The core question here is currently being resolved at dart-lang/language#1802. Re-opening and marking as blocked. |
Was just discussing this bug with @srawlins and realized that if we want (@eernstg I think you've been working on test cases for this sort of thing? You might want to add some test cases for |
Thanks! |
(The analyzer might want to hint that |
Good point. @pq or @bwilkerson, do you know whether this would be better as a lint or a hint? And would you mind taking ownership of this feature request? |
dart-lang/language#1802 has been closed: |
[Edit] We do have a rule here which says that a term like
a<b, c>.toString()
must be parsed as a constructor invocation whena<b, c>
is a type literal, not as an instance method invocation on that type literal. But the specification does not explicitly address the case wherea<b, c>
is a generic function instantiation.Old text (striking out the part which is currently not resolved, cf. dart-lang/language#1802):
Consider the test co19/LanguageFeatures/Constructor-tear-offs/ambiguities_A08_t02.dart.
In this test there is an expression
a<b, c>.toString()
wherea
is a generic function andb
andc
are types. The parser should parsea<b, c>
as<primary><selector>
where<selector>
further derives<typeArguments>
, because the next token is'.'
(which is one of those tokens that force the preceding construct to be considered as a<typeArguments>
). I believe this part works as it should.However, that expression should then denote atoString()
invocation on a function object that is obtained by explicit generic function instantiation, and there should not be any errors. The CFE reports a compile-time errorMethod not found
.The text was updated successfully, but these errors were encountered: