Skip to content

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

Closed
@johnniwinther

Description

@johnniwinther

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work ondart-model-analyzer-specIssues with the analyzer's implementation of the language speclegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions