Skip to content

Commit d8e7f99

Browse files
authored
Display the immediate representation type, not any erasure (#3685)
1 parent 91c361a commit d8e7f99

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Diff for: lib/src/model/extension_type.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class ExtensionType extends InheritingContainer
1414
final ExtensionTypeElement element;
1515

1616
late final ElementType representationType =
17-
getTypeFor(element.typeErasure, library);
17+
getTypeFor(element.representation.type, library);
1818

1919
ExtensionType(this.element, super.library, super.packageGraph);
2020

Diff for: test/templates/extension_type_test.dart

+14-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ extension type One<E>(List<E> it) {
6666
]);
6767
}
6868

69-
void test_representationType() async {
69+
void test_representationType_class() async {
7070
await createPackageWithLibrary('''
7171
class Foo<E> {}
7272
extension type One<E>(Foo<E> it) {}
@@ -81,6 +81,19 @@ extension type One<E>(Foo<E> it) {}
8181
]);
8282
}
8383

84+
void test_representationType_extensionType() async {
85+
await createPackageWithLibrary('''
86+
extension type One(int one) {}
87+
extension type Two(One two) {}
88+
''');
89+
var htmlLines = readLines(['lib', 'Two-extension-type.html']);
90+
91+
htmlLines.expectMainContentContainsAllInOrder([
92+
matches('<dt>on</dt>'),
93+
matches('<a href="../lib/One-extension-type.html">One</a>'),
94+
]);
95+
}
96+
8497
void test_classInterfaces() async {
8598
await createPackageWithLibrary('''
8699
class Base<E> {}

0 commit comments

Comments
 (0)