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

[analyzer] Expression.staticParameterElement should not be null for method with generics #45964

Open
a14n opened this issue May 10, 2021 · 1 comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@a14n
Copy link
Contributor

a14n commented May 10, 2021

Follow up on dart-lang/linter#2530

On the following example functionExpression.staticParameterElement.library is null for the generic case ff but not for f. Both should be set with a non-null variable.

class MyMap<K, V> {
  void f(void Function(int a) p) {}
  void ff(void Function(K a) p) {}
}
m() {
  MyMap().f((int? a) {}); // staticParameterElement.library is correctly set
  MyMap().ff((Object? a) {}); // staticParameterElement.library is null
}

(with analyzer-1.5.0)

/cc @scheglov

@mit-mit mit-mit added the area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. label May 10, 2021
@jcollins-g jcollins-g added analyzer-api Issues that impact the public API of the analyzer package P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels May 10, 2021
@a14n
Copy link
Contributor Author

a14n commented Aug 3, 2022

This issue still exist in analyzer-4.3.1. I just faced it again in dart-lang/linter#3568 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-api Issues that impact the public API of the analyzer package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants