diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart index 3c4dd9eabba..132e961731f 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/shared.dart @@ -187,8 +187,11 @@ class ExhaustivenessCache< StaticType typeArgument = getStaticType(futureOrTypeArgument); StaticType futureType = getStaticType( typeOperations.instantiateFuture(futureOrTypeArgument)); + bool isImplicitlyNullable = + typeOperations.isNullable(futureOrTypeArgument); staticType = new FutureOrStaticType( - typeOperations, this, nonNullable, typeArgument, futureType); + typeOperations, this, nonNullable, typeArgument, futureType, + isImplicitlyNullable: isImplicitlyNullable); } else { EnumClass? enumClass = enumOperations.getEnumClass(nonNullable); if (enumClass != null) { @@ -211,8 +214,11 @@ class ExhaustivenessCache< staticType = new ListTypeStaticType(typeOperations, this, nonNullable); } else { - staticType = - new TypeBasedStaticType(typeOperations, this, nonNullable); + bool isImplicitlyNullable = + typeOperations.isNullable(nonNullable); + staticType = new TypeBasedStaticType( + typeOperations, this, nonNullable, + isImplicitlyNullable: isImplicitlyNullable); Type? bound = typeOperations.getTypeVariableBound(type); if (bound != null) { staticType = diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart index 6124eeff684..c74f287bfd7 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/static_type.dart @@ -69,6 +69,11 @@ abstract class StaticType { /// This is only used for print the type as part of a [Witness]. bool get isRecord; + /// Return `true` if this type is implicitly nullable. + /// + /// This is used to omit the '?' for the [name] in the [NullableStaticType]. + bool get isImplicitlyNullable; + /// Returns the name of this static type. /// /// This is used for printing [Space]s. @@ -218,6 +223,9 @@ class _NonNullableObject extends _BaseStaticType with _ObjectFieldMixin { @override StaticType get nonNullable => this; + + @override + bool get isImplicitlyNullable => false; } class _NeverType extends _BaseStaticType with _ObjectFieldMixin { @@ -240,6 +248,9 @@ class _NeverType extends _BaseStaticType with _ObjectFieldMixin { @override StaticType get nonNullable => this; + + @override + bool get isImplicitlyNullable => false; } class _NullType extends NullableStaticType with _ObjectFieldMixin { @@ -257,6 +268,9 @@ class _NullType extends NullableStaticType with _ObjectFieldMixin { return const []; } + @override + bool get isImplicitlyNullable => true; + @override String get name => 'Null'; } @@ -284,7 +298,11 @@ class NullableStaticType extends _BaseStaticType with _ObjectFieldMixin { } @override - String get name => '${underlying.name}?'; + String get name => + underlying.isImplicitlyNullable ? underlying.name : '${underlying.name}?'; + + @override + bool get isImplicitlyNullable => true; @override StaticType get nullable => this; @@ -356,6 +374,9 @@ class WrappedStaticType extends _BaseStaticType { @override String get name => wrappedType.name; + @override + bool get isImplicitlyNullable => wrappedType.isImplicitlyNullable; + @override Iterable getSubtypes(Set keysOfInterest) => wrappedType .getSubtypes(keysOfInterest) diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart index b505dea0969..10fe31d6e4c 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types.dart @@ -26,8 +26,11 @@ class TypeBasedStaticType extends NonNullableStaticType { final TypeOperations _typeOperations; final FieldLookup _fieldLookup; final Type _type; + @override + final bool isImplicitlyNullable; - TypeBasedStaticType(this._typeOperations, this._fieldLookup, this._type); + TypeBasedStaticType(this._typeOperations, this._fieldLookup, this._type, + {required this.isImplicitlyNullable}); @override Map get fields => _fieldLookup.getFieldTypes(_type); @@ -109,7 +112,8 @@ abstract class RestrictedStaticType extends TypeBasedStaticType { - BoolStaticType(super.typeOperations, super.fieldLookup, super.type); + BoolStaticType(super.typeOperations, super.fieldLookup, super.type) + : super(isImplicitlyNullable: false); @override bool get isSealed => true; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/enum.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/enum.dart index 548aafdb45c..3ea5aff181e 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/enum.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/enum.dart @@ -77,7 +77,8 @@ class EnumStaticType List? _enumElements; EnumStaticType( - super.typeOperations, super.fieldLookup, super.type, this._enumInfo); + super.typeOperations, super.fieldLookup, super.type, this._enumInfo) + : super(isImplicitlyNullable: false); @override bool get isSealed => true; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/future_or.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/future_or.dart index 5ae8dc2c292..fd534bdb6a3 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/future_or.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/future_or.dart @@ -16,7 +16,8 @@ class FutureOrStaticType final StaticType _futureType; FutureOrStaticType(super.typeOperations, super.fieldLookup, super.type, - this._typeArgument, this._futureType); + this._typeArgument, this._futureType, + {required super.isImplicitlyNullable}); @override bool get isSealed => true; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart index 727cdf02433..e593b4f71fc 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/list.dart @@ -55,7 +55,8 @@ part of '../types.dart'; /// and the list of n or more elements as the witness candidates. class ListTypeStaticType extends TypeBasedStaticType { - ListTypeStaticType(super.typeOperations, super.fieldLookup, super.type); + ListTypeStaticType(super.typeOperations, super.fieldLookup, super.type) + : super(isImplicitlyNullable: false); @override bool get isSealed => true; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart index d13cf38bb36..fbeaf8cd870 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/record.dart @@ -23,7 +23,8 @@ part of '../types.dart'; /// Not that the fields of the record types _are_ using the type, so that /// the `$1` field of `(String, Object)` is known to contain only `String`s. class RecordStaticType extends TypeBasedStaticType { - RecordStaticType(super.typeOperations, super.fieldLookup, super.type); + RecordStaticType(super.typeOperations, super.fieldLookup, super.type) + : super(isImplicitlyNullable: false); @override bool get isRecord => true; diff --git a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/sealed.dart b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/sealed.dart index 5cdafa98177..1a0ddd1a1d3 100644 --- a/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/sealed.dart +++ b/pkg/_fe_analyzer_shared/lib/src/exhaustiveness/types/sealed.dart @@ -57,7 +57,8 @@ class SealedClassStaticType Iterable? _subtypes; SealedClassStaticType(super.typeOperations, super.fieldLookup, super.type, - this._cache, this._sealedClassOperations, this._sealedInfo); + this._cache, this._sealedClassOperations, this._sealedInfo) + : super(isImplicitlyNullable: false); @override bool get isSealed => true; diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or.dart index abc9280b17f..eb3be05faf2 100644 --- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or.dart +++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or.dart @@ -471,10 +471,10 @@ exhaustiveNullable( break; } /* - checkingOrder={FutureOr?,FutureOr,Null,bool?,Future,bool,Null,true,false}, + checkingOrder={FutureOr,FutureOr,Null,bool?,Future,bool,Null,true,false}, expandedSubtypes={true,false,Null,Future}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ switch (f3) { /*space=true*/ @@ -566,11 +566,11 @@ nonExhaustiveNullable( break; } /* - checkingOrder={FutureOr?,FutureOr,Null,bool?,Future,bool,Null,true,false}, + checkingOrder={FutureOr,FutureOr,Null,bool?,Future,bool,Null,true,false}, error=non-exhaustive:null, expandedSubtypes={true,false,Null,Future}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ switch (f3) { /*space=true*/ @@ -587,11 +587,11 @@ nonExhaustiveNullable( break; } /* - checkingOrder={FutureOr?,FutureOr,Null,bool?,Future,bool,Null,true,false}, + checkingOrder={FutureOr,FutureOr,Null,bool?,Future,bool,Null,true,false}, error=non-exhaustive:Future(), expandedSubtypes={true,false,Null,Future}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ switch (f3) { /*space=true*/ diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart index c2ee705ee7b..5b055325701 100644 --- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart +++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/future_or_members.dart @@ -14,16 +14,11 @@ membersMethod(o) { type=Object? */ switch (o) { - Typedef( - :var hashCode - ) /*cfe.space=FutureOr?(hashCode: int)*/ /*analyzer.space=FutureOr(hashCode: int)*/ => + Typedef(:var hashCode) /*space=FutureOr(hashCode: int)*/ => hashCode, Typedef( :var runtimeType - ) /*cfe. - error=unreachable, - space=FutureOr?(runtimeType: Type) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(runtimeType: Type) */ @@ -31,10 +26,7 @@ membersMethod(o) { runtimeType, Typedef( :var toString - ) /*cfe. - error=unreachable, - space=FutureOr?(toString: String Function()) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(toString: String Function()) */ @@ -42,10 +34,7 @@ membersMethod(o) { toString(), Typedef( :var noSuchMethod - ) /*cfe. - error=unreachable, - space=FutureOr?(noSuchMethod: dynamic Function(Invocation)) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(noSuchMethod: dynamic Function(Invocation)) */ @@ -57,11 +46,11 @@ membersMethod(o) { exhaustiveHashCode(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, fields={hashCode:int}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, @@ -70,20 +59,18 @@ exhaustiveHashCode(Typedef o) { type=FutureOr */ switch (o) { - Typedef( - :int hashCode - ) /*cfe.space=FutureOr?(hashCode: int)*/ /*analyzer.space=FutureOr(hashCode: int)*/ => + Typedef(:int hashCode) /*space=FutureOr(hashCode: int)*/ => hashCode, }; } exhaustiveRuntimeType(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, fields={runtimeType:Type}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, @@ -92,20 +79,18 @@ exhaustiveRuntimeType(Typedef o) { type=FutureOr */ switch (o) { - Typedef( - :Type runtimeType - ) /*cfe.space=FutureOr?(runtimeType: Type)*/ /*analyzer.space=FutureOr(runtimeType: Type)*/ => + Typedef(:Type runtimeType) /*space=FutureOr(runtimeType: Type)*/ => runtimeType, }; } exhaustiveToString(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, fields={toString:String Function()}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, @@ -116,18 +101,18 @@ exhaustiveToString(Typedef o) { switch (o) { Typedef( :String Function() toString - ) /*cfe.space=FutureOr?(toString: String Function())*/ /*analyzer.space=FutureOr(toString: String Function())*/ => + ) /*space=FutureOr(toString: String Function())*/ => toString, }; } exhaustiveNoSuchMethod(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, fields={noSuchMethod:dynamic Function(Invocation)}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, @@ -138,19 +123,19 @@ exhaustiveNoSuchMethod(Typedef o) { switch (o) { Typedef( :dynamic Function(Invocation) noSuchMethod - ) /*cfe.space=FutureOr?(noSuchMethod: dynamic Function(Invocation))*/ /*analyzer.space=FutureOr(noSuchMethod: dynamic Function(Invocation))*/ => + ) /*space=FutureOr(noSuchMethod: dynamic Function(Invocation))*/ => noSuchMethod, }; } nonExhaustiveRestrictedValue(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, error=non-exhaustive:Null(hashCode: int()), expandedSubtypes={Object,Null,Future}, fields={hashCode:int}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, error=non-exhaustive:Future(hashCode: int()), @@ -160,21 +145,18 @@ nonExhaustiveRestrictedValue(Typedef o) { type=FutureOr */ switch (o) { - Typedef( - hashCode: 5 - ) /*cfe.space=FutureOr?(hashCode: 5)*/ /*analyzer.space=FutureOr(hashCode: 5)*/ => - 5, + Typedef(hashCode: 5) /*space=FutureOr(hashCode: 5)*/ => 5, }; } nonExhaustiveRestrictedType(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _), expandedSubtypes={Object,Null,Future}, fields={noSuchMethod:dynamic Function(Invocation)}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, error=non-exhaustive:Future(noSuchMethod: dynamic Function(Invocation) _), @@ -186,18 +168,18 @@ nonExhaustiveRestrictedType(Typedef o) { switch (o) { Typedef( :int Function(Invocation) noSuchMethod - ) /*cfe.space=FutureOr?(noSuchMethod: int Function(Invocation))*/ /*analyzer.space=FutureOr(noSuchMethod: int Function(Invocation))*/ => + ) /*space=FutureOr(noSuchMethod: int Function(Invocation))*/ => noSuchMethod, }; } unreachableMethod(Typedef o) { return /*cfe. - checkingOrder={FutureOr?,FutureOr,Null,Object?,Future,Object,Null}, + checkingOrder={FutureOr,FutureOr,Null,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, fields={hashCode:int,noSuchMethod:dynamic Function(Invocation),runtimeType:Type,toString:String Function()}, subtypes={FutureOr,Null}, - type=FutureOr? + type=FutureOr */ /*analyzer. checkingOrder={FutureOr,Object?,Future,Object,Null}, expandedSubtypes={Object,Null,Future}, @@ -206,16 +188,11 @@ unreachableMethod(Typedef o) { type=FutureOr */ switch (o) { - Typedef( - :var hashCode - ) /*cfe.space=FutureOr?(hashCode: int)*/ /*analyzer.space=FutureOr(hashCode: int)*/ => + Typedef(:var hashCode) /*space=FutureOr(hashCode: int)*/ => hashCode, Typedef( :var runtimeType - ) /*cfe. - error=unreachable, - space=FutureOr?(runtimeType: Type) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(runtimeType: Type) */ @@ -223,10 +200,7 @@ unreachableMethod(Typedef o) { runtimeType, Typedef( :var toString - ) /*cfe. - error=unreachable, - space=FutureOr?(toString: String Function()) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(toString: String Function()) */ @@ -234,10 +208,7 @@ unreachableMethod(Typedef o) { toString(), Typedef( :var noSuchMethod - ) /*cfe. - error=unreachable, - space=FutureOr?(noSuchMethod: dynamic Function(Invocation)) - */ /*analyzer. + ) /* error=unreachable, space=FutureOr(noSuchMethod: dynamic Function(Invocation)) */ diff --git a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart index c709dee376e..ec0b042d9be 100644 --- a/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart +++ b/pkg/_fe_analyzer_shared/test/exhaustiveness/data/void_members.dart @@ -12,16 +12,10 @@ membersMethod(o) { type=Object? */ switch (o) { - Typedef( - :var hashCode - ) /*cfe.space=void?(hashCode: int)*/ /*analyzer.space=void(hashCode: int)*/ => - hashCode, + Typedef(:var hashCode) /*space=void(hashCode: int)*/ => hashCode, Typedef( :var runtimeType - ) /*cfe. - error=unreachable, - space=void?(runtimeType: Type) - */ /*analyzer. + ) /* error=unreachable, space=void(runtimeType: Type) */ @@ -29,10 +23,7 @@ membersMethod(o) { runtimeType, Typedef( :var toString - ) /*cfe. - error=unreachable, - space=void?(toString: String Function()) - */ /*analyzer. + ) /* error=unreachable, space=void(toString: String Function()) */ @@ -40,10 +31,7 @@ membersMethod(o) { toString(), Typedef( :var noSuchMethod - ) /*cfe. - error=unreachable, - space=void?(noSuchMethod: dynamic Function(Invocation)) - */ /*analyzer. + ) /* error=unreachable, space=void(noSuchMethod: dynamic Function(Invocation)) */ @@ -55,46 +43,40 @@ membersMethod(o) { exhaustiveHashCode(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, fields={hashCode:int}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. fields={hashCode:int}, type=void */ switch (o) { - Typedef( - :int hashCode - ) /*cfe.space=void?(hashCode: int)*/ /*analyzer.space=void(hashCode: int)*/ => - hashCode, + Typedef(:int hashCode) /*space=void(hashCode: int)*/ => hashCode, }; } exhaustiveRuntimeType(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, fields={runtimeType:Type}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. fields={runtimeType:Type}, type=void */ switch (o) { - Typedef( - :Type runtimeType - ) /*cfe.space=void?(runtimeType: Type)*/ /*analyzer.space=void(runtimeType: Type)*/ => - runtimeType, + Typedef(:Type runtimeType) /*space=void(runtimeType: Type)*/ => runtimeType, }; } exhaustiveToString(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, fields={toString:String Function()}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. fields={toString:String Function()}, type=void @@ -102,17 +84,17 @@ exhaustiveToString(Typedef o) { switch (o) { Typedef( :String Function() toString - ) /*cfe.space=void?(toString: String Function())*/ /*analyzer.space=void(toString: String Function())*/ => + ) /*space=void(toString: String Function())*/ => toString, }; } exhaustiveNoSuchMethod(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, fields={noSuchMethod:dynamic Function(Invocation)}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. fields={noSuchMethod:dynamic Function(Invocation)}, type=void @@ -120,38 +102,35 @@ exhaustiveNoSuchMethod(Typedef o) { switch (o) { Typedef( :dynamic Function(Invocation) noSuchMethod - ) /*cfe.space=void?(noSuchMethod: dynamic Function(Invocation))*/ /*analyzer.space=void(noSuchMethod: dynamic Function(Invocation))*/ => + ) /*space=void(noSuchMethod: dynamic Function(Invocation))*/ => noSuchMethod, }; } nonExhaustiveRestrictedValue(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, error=non-exhaustive:void(hashCode: int()), fields={hashCode:int}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. error=non-exhaustive:void(hashCode: int()), fields={hashCode:int}, type=void */ switch (o) { - Typedef( - hashCode: 5 - ) /*cfe.space=void?(hashCode: 5)*/ /*analyzer.space=void(hashCode: 5)*/ => - 5, + Typedef(hashCode: 5) /*space=void(hashCode: 5)*/ => 5, }; } nonExhaustiveRestrictedType(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _), fields={noSuchMethod:dynamic Function(Invocation)}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. error=non-exhaustive:void(noSuchMethod: dynamic Function(Invocation) _), fields={noSuchMethod:dynamic Function(Invocation)}, @@ -160,32 +139,26 @@ nonExhaustiveRestrictedType(Typedef o) { switch (o) { Typedef( :int Function(Invocation) noSuchMethod - ) /*cfe.space=void?(noSuchMethod: int Function(Invocation))*/ /*analyzer.space=void(noSuchMethod: int Function(Invocation))*/ => + ) /*space=void(noSuchMethod: int Function(Invocation))*/ => noSuchMethod, }; } unreachableMethod(Typedef o) { return /*cfe. - checkingOrder={void?,void,Null}, + checkingOrder={void,void,Null}, fields={hashCode:int,noSuchMethod:dynamic Function(Invocation),runtimeType:Type,toString:String Function()}, subtypes={void,Null}, - type=void? + type=void */ /*analyzer. fields={hashCode:int,noSuchMethod:dynamic Function(Invocation),runtimeType:Type,toString:String Function()}, type=void */ switch (o) { - Typedef( - :var hashCode - ) /*cfe.space=void?(hashCode: int)*/ /*analyzer.space=void(hashCode: int)*/ => - hashCode, + Typedef(:var hashCode) /*space=void(hashCode: int)*/ => hashCode, Typedef( :var runtimeType - ) /*cfe. - error=unreachable, - space=void?(runtimeType: Type) - */ /*analyzer. + ) /* error=unreachable, space=void(runtimeType: Type) */ @@ -193,10 +166,7 @@ unreachableMethod(Typedef o) { runtimeType, Typedef( :var toString - ) /*cfe. - error=unreachable, - space=void?(toString: String Function()) - */ /*analyzer. + ) /* error=unreachable, space=void(toString: String Function()) */ @@ -204,10 +174,7 @@ unreachableMethod(Typedef o) { toString(), Typedef( :var noSuchMethod - ) /*cfe. - error=unreachable, - space=void?(noSuchMethod: dynamic Function(Invocation)) - */ /*analyzer. + ) /* error=unreachable, space=void(noSuchMethod: dynamic Function(Invocation)) */