Skip to content

InheritingContainer.typeParameters stores type parameter with a bound under wrong name #4302

Open

Description

@sgrekhov

The current behavior is shown in the test below. Type parameter with a bound is stored under the name U extends num, not under U.

@reflectiveTest
class TypeParametersTest extends Co19TestBase {
  void test_typeParameter() async {
    var library = await bootPackageWithLibrary('''
class C<U extends num> {}
''');
    var c = library.classes.named('C');
    print(c.typeParameters.named('U extends num').documentation); // Ok
    print(c.typeParameters.named('U').documentation); // Bad state: No TypeParameter elements named 'U'
  }
}

Class Co19TestBase is defined here.

Dart SDK version: 3.15.0-57.0.dev (dev) (Tue Oct 20 21:06:40 2026 -0700) on "windows_x64"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions