File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 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 {
4545 if (extendedType is DynamicType || extendedType is VoidType ) {
4646 return true ;
4747 }
48+ extendedType = library.element.typeSystem.promoteToNonNull (extendedType);
4849 var otherType = container.modelType.type;
4950 if (otherType is InterfaceType ) {
5051 otherType = library.element.typeSystem.instantiateInterfaceToBounds (
Original file line number Diff line number Diff line change @@ -314,6 +314,25 @@ extension E on C {
314314 ]);
315315 }
316316
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+
317336 void test_instancePropertyAccessor_fromExtensionOfSupertype () async {
318337 await createPackageWithLibrary ('''
319338class C<T> {}
You can’t perform that action at this time.
0 commit comments