Skip to content

No error in analyzer when tearing off a call method of a generic function type #46902

@sgrekhov

Description

@sgrekhov

The following test produces an errors in CFE but has no issues in CFE

// SharedOptions=--enable-experiment=constructor-tearoffs

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

main() {
  var funcValue1 = foo1;
  int Function(int) f1 = funcValue1.call;
//                                  ^^^^
// [analyzer] unspecified
// [cfe] unspecified

  T foo2<T>(T value) => value;
  var funcValue2 = foo2;
  int Function(int) f2 = funcValue2.call;
//                                  ^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

According to the spec it must be an error

Tested on Dart SDK version: 2.15.0-edge.b2b8e59b2863ef02709dfdb750e9ae8e3732389c (be) (Fri Aug 13 01:08:51 2021 +0000) on "windows_x64"

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onlegacy-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