Skip to content

Analyzer doesn't check bounds correctly for generic function types as type arguments #45394

@leafpetersen

Description

@leafpetersen

The instantiation of CB in the test method in the following example should be an error, since FB<F> is not subtype related to F. The analyzer when run with the --enable-experiment=generic-metadata flag emits no error.

typedef F = T Function<T>(T);

typedef FB<T extends F> = S Function<S extends T>(S);

class CB<T extends F> {}

void test() {
  CB<FB<F>>();
}

cc @scheglov

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions