File tree 2 files changed +20
-0
lines changed
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ class Extension extends Container {
45
45
if (extendedType is DynamicType || extendedType is VoidType ) {
46
46
return true ;
47
47
}
48
+ extendedType = library.element.typeSystem.promoteToNonNull (extendedType);
48
49
var otherType = container.modelType.type;
49
50
if (otherType is InterfaceType ) {
50
51
otherType = library.element.typeSystem.instantiateInterfaceToBounds (
Original file line number Diff line number Diff line change @@ -314,6 +314,25 @@ extension E on C {
314
314
]);
315
315
}
316
316
317
+ void test_instancePropertyAccessor_fromExtension_onNullableType () async {
318
+ await createPackageWithLibrary ('''
319
+ class C {}
320
+
321
+ extension E on C? {
322
+ /// An instance getter.
323
+ int get f => 1;
324
+ }
325
+ ''' );
326
+ var htmlLines = readLines (['lib' , 'C-class.html' ]);
327
+
328
+ htmlLines.expectMainContentContainsAllInOrder ([
329
+ matches ('<h2>Properties</h2>' ),
330
+ matches ('<dt id="f" class="property">' ),
331
+ matches ('<a href="../lib/E/f.html">f</a>' ),
332
+ matches ('An instance getter.' ),
333
+ ]);
334
+ }
335
+
317
336
void test_instancePropertyAccessor_fromExtensionOfSupertype () async {
318
337
await createPackageWithLibrary ('''
319
338
class C<T> {}
You can’t perform that action at this time.
0 commit comments