Skip to content

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

@a14n

Description

@a14n

Follow up on dart-archive/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onanalyzer-apiIssues that impact the public API of the analyzer packagearea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions