-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Analyzer has trouble analyzing function-typed type parameters. #27392
Comments
…eter types. R=brianwilkerson@google.com BUG= #27392 Review URL: https://codereview.chromium.org/2360303003 .
First part is fixed in 65d2a2c. |
The assignment warning looks valid to me. In |
I think the warning is wrong (and not just because it omits the type parameters on The assignment to The (Also, There should be a runtime error on the |
I'm looking at
So, |
Ack, you are correct. The subtyping relation on interfaces is based on the "more specific" relation of the type parameters, not the subtype relation. I had missed that. |
Tested in dartpad.
See https://dartpad.dartlang.org/f983c5dac60898576edcbd38cadfe2cd for runnable example.
In the code:
the analyzer claims that "action is not a method". If I change
action(value)
to(action)(value)
the error changes to "cannot invoke a non-function". It doesn't realize that because U extends a function type, action is a function.In the following code:
strong mode has no problem, but non-strong-mode says that:
It's missing the type parameters on
Action
, and even then it's still wrong.The text was updated successfully, but these errors were encountered: