@@ -390,22 +390,23 @@ class TypeVariableTests {
390390 }
391391
392392 void processCheckedType (DartType type) {
393- if (type is InterfaceType ) {
393+ var typeWithoutNullability = type.withoutNullability;
394+ if (typeWithoutNullability is InterfaceType ) {
394395 // Register that if [cls] needs type arguments then so do the entities
395396 // that declare type variables occurring in [type].
396- ClassEntity cls = type .element;
397- registerDependencies (_getClassNode (cls), type );
397+ ClassEntity cls = typeWithoutNullability .element;
398+ registerDependencies (_getClassNode (cls), typeWithoutNullability );
398399 }
399- if (type is FutureOrType ) {
400- // [type ] is `FutureOr<X>`.
400+ if (typeWithoutNullability is FutureOrType ) {
401+ // [typeWithoutNullability ] is `FutureOr<X>`.
401402
402403 // For the implied `is Future<X>` test, register that if `Future` needs
403404 // type arguments then so do the entities that declare type variables
404405 // occurring in `type.typeArgument`.
405- registerDependencies (
406- _getClassNode (commonElements.futureClass), type .typeArgument);
406+ registerDependencies (_getClassNode (commonElements.futureClass),
407+ typeWithoutNullability .typeArgument);
407408 // Process `type.typeArgument` for the implied `is X` test.
408- processCheckedType (type .typeArgument);
409+ processCheckedType (typeWithoutNullability .typeArgument);
409410 }
410411 }
411412
@@ -486,11 +487,12 @@ class TypeVariableTests {
486487 }
487488
488489 void processType (DartType type, {bool direct: true }) {
489- if (type is FutureOrType ) {
490+ var typeWithoutNullability = type.withoutNullability;
491+ if (typeWithoutNullability is FutureOrType ) {
490492 _getClassNode (commonElements.futureClass).markIndirectTest ();
491- processType (type .typeArgument, direct: false );
493+ processType (typeWithoutNullability .typeArgument, direct: false );
492494 } else {
493- type .forEachTypeVariable ((TypeVariableType type) {
495+ typeWithoutNullability .forEachTypeVariable ((TypeVariableType type) {
494496 processTypeVariableType (type, direct: direct);
495497 });
496498 }
@@ -568,10 +570,12 @@ class TypeVariableTests {
568570 /// If [type] is of the form `FutureOr<X>` , also register the implicit
569571 /// is-tests of `Future<X>` and `X` .
570572 void addImplicitCheck (DartType type) {
571- if (implicitIsChecks.add (type)) {
572- if (type is FutureOrType ) {
573- addImplicitCheck (commonElements.futureType (type.typeArgument));
574- addImplicitCheck (type.typeArgument);
573+ var typeWithoutNullability = type.withoutNullability;
574+ if (implicitIsChecks.add (typeWithoutNullability)) {
575+ if (typeWithoutNullability is FutureOrType ) {
576+ addImplicitCheck (
577+ commonElements.futureType (typeWithoutNullability.typeArgument));
578+ addImplicitCheck (typeWithoutNullability.typeArgument);
575579 }
576580 }
577581 }
@@ -581,9 +585,11 @@ class TypeVariableTests {
581585 }
582586
583587 world.isChecks.forEach ((DartType type) {
584- if (type is FutureOrType ) {
585- addImplicitCheck (commonElements.futureType (type.typeArgument));
586- addImplicitCheck (type.typeArgument);
588+ var typeWithoutNullability = type.withoutNullability;
589+ if (typeWithoutNullability is FutureOrType ) {
590+ addImplicitCheck (
591+ commonElements.futureType (typeWithoutNullability.typeArgument));
592+ addImplicitCheck (typeWithoutNullability.typeArgument);
587593 }
588594 });
589595
0 commit comments