Skip to content

Analyzer fails on implicit tearoff through explicit instantiation of extension method #47366

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

Closed
johnniwinther opened this issue Oct 4, 2021 · 2 comments
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

@johnniwinther
Copy link
Member

With https://dart-review.googlesource.com/c/sdk/+/215021 the test language/explicit_type_instantiation_parsing_test has been updated to use perform an explicit instantiation on a receiver that is callable through an extension method:

...
Object? v = null;
...
extension <T extends Object?> on T {
  ...
  Object? call<R, S>([_]) => null;
  ...
}
void main() {
  ...
  // Since `v` has type `Object?`, this is an extension invocation of the
  // implicit `call` tear off.
  /**/ v<int, String>; // line 312
}

This case is not handled by the analyzer which fails with

static error failures:
- Unexpected error at line 312, column 8, length 1: COMPILE_TIME_ERROR.DISALLOWED_TYPE_INSTANTIATION_EXPRESSION
@johnniwinther johnniwinther added the legacy-area-analyzer Use area-devexp instead. label Oct 4, 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 Oct 4, 2021
@scheglov
Copy link
Contributor

scheglov commented Oct 4, 2021

@srawlins

@srawlins
Copy link
Member

srawlins commented Oct 4, 2021

Thanks for the bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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