Skip to content

Analyzer does not check that bounds are satisfied by generic metadata arguments #45579

Closed
@leafpetersen

Description

@leafpetersen

The following example should be an error, since String is an invalid type argument for the generic class Y:

class Y<T extends num> {
  const Y();
}

@Y<String>()

class Test1 {}

The analyzer currently issues no errors on this code when run with --experiment=generic-metadata.

This is tests by co19/src/Language/Metadata/syntax_t11.dart, but unfortunately that test is broken pending the next co19 roll.

cc @devoncarew @scheglov @natebosch

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions