Skip to content

Generic function type as a type argument of the generic function type alias works incorrectly. #45313

@iarkh

Description

@iarkh

Dart SDK version: 2.13.0-114.0.dev (dev) (Sat Mar 6 18:27:50 2021 -0800) on "windows_x64"

The following code example declares generic function typedef TEST_TYPEDEF and then try to assign TEST_TYPEDEF variable and check its type:

typedef TEST_TYPEDEF<TT extends T Function<T>(T)> = void Function<TTT extends TT>();
void  testme<TT extends T Function<T>(T)>() {}

main() {
  print(testme is TEST_TYPEDEF);
  TEST_TYPEDEF ttttt = testme;
  print(ttttt is TEST_TYPEDEF);
}

It's expected that if I succssffully assign testme to the variable of the type TEST_TYPEDEF, ttttt is TEST_TYPEDEF should report true. However, this is not so here: there are no errors and the example above twice prints false unexpectidly.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions