Skip to content

No type check in analyzer when explicitly instantiated generic 'call' method is called with wrong type #47212

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
sgrekhov opened this issue Sep 14, 2021 · 1 comment
Assignees
Labels
dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on

Comments

@sgrekhov
Copy link
Contributor

This is probably related with #47211. The following test works in CFE but fails in analyzer

T foo1<T>(T value) => value;

main() {
  var funcValue1 = foo1;
  var f1 = funcValue1.call<int>;
  f1(42);
  f1("Lily was here");   // No error in analyzer here
//   ^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

  T foo2<T>(T value) => value;
  var funcValue2 = foo2;
  var f2 = funcValue2.call<int>;
  f2(42);
  f2("Lily was here");   // No error in analyzer here
//   ^^^^^^^^^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

Tested on the edge version of the analyzer

@sgrekhov sgrekhov added the legacy-area-analyzer Use area-devexp instead. label Sep 14, 2021
@scheglov scheglov added dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec P2 A bug or feature request we're likely to work on labels Sep 14, 2021
@scheglov
Copy link
Contributor

@srawlins

@srawlins srawlins self-assigned this Sep 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dart-model-analyzer-spec Issues with the analyzer's implementation of the language spec legacy-area-analyzer Use area-devexp instead. P2 A bug or feature request we're likely to work on
Projects
None yet
Development

No branches or pull requests

3 participants