[_fe_analyzer_shared] Don't add '?' if type is nullable

This adds an `isImplicitlyNullable` property to `StaticType`. This
is used to avoid the `?` suffix when printing implicitly nullable
types such as `void`.

Change-Id: I02d4197688b37c08aef231b249574e3fdd87cf21
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/292861
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This commit is contained in:
Johnni Winther 2023-04-03 20:47:43 +00:00 committed by Commit Queue
parent db0dfec609
commit 0fcdb66666
12 changed files with 111 additions and 136 deletions

View file

@ -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 =

View file

@ -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<StaticType> getSubtypes(Set<Key> keysOfInterest) => wrappedType
.getSubtypes(keysOfInterest)

View file

@ -26,8 +26,11 @@ class TypeBasedStaticType<Type extends Object> extends NonNullableStaticType {
final TypeOperations<Type> _typeOperations;
final FieldLookup<Type> _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<Key, StaticType> get fields => _fieldLookup.getFieldTypes(_type);
@ -109,7 +112,8 @@ abstract class RestrictedStaticType<Type extends Object,
final String name;
RestrictedStaticType(super.typeOperations, super.fieldLookup, super.type,
this.restriction, this.name);
this.restriction, this.name)
: super(isImplicitlyNullable: false);
}
/// [StaticType] for an object restricted to a single value.

View file

@ -6,7 +6,8 @@ part of '../types.dart';
/// [StaticType] for the `bool` type.
class BoolStaticType<Type extends Object> extends TypeBasedStaticType<Type> {
BoolStaticType(super.typeOperations, super.fieldLookup, super.type);
BoolStaticType(super.typeOperations, super.fieldLookup, super.type)
: super(isImplicitlyNullable: false);
@override
bool get isSealed => true;

View file

@ -77,7 +77,8 @@ class EnumStaticType<Type extends Object, EnumElement extends Object>
List<StaticType>? _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;

View file

@ -16,7 +16,8 @@ class FutureOrStaticType<Type extends Object>
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;

View file

@ -55,7 +55,8 @@ part of '../types.dart';
/// and the list of n or more elements as the witness candidates.
class ListTypeStaticType<Type extends Object>
extends TypeBasedStaticType<Type> {
ListTypeStaticType(super.typeOperations, super.fieldLookup, super.type);
ListTypeStaticType(super.typeOperations, super.fieldLookup, super.type)
: super(isImplicitlyNullable: false);
@override
bool get isSealed => true;

View file

@ -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<Type extends Object> extends TypeBasedStaticType<Type> {
RecordStaticType(super.typeOperations, super.fieldLookup, super.type);
RecordStaticType(super.typeOperations, super.fieldLookup, super.type)
: super(isImplicitlyNullable: false);
@override
bool get isRecord => true;

View file

@ -57,7 +57,8 @@ class SealedClassStaticType<Type extends Object, Class extends Object>
Iterable<StaticType>? _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;

View file

@ -471,10 +471,10 @@ exhaustiveNullable(
break;
}
/*
checkingOrder={FutureOr<bool?>?,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
checkingOrder={FutureOr<bool?>,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
expandedSubtypes={true,false,Null,Future<bool?>},
subtypes={FutureOr<bool?>,Null},
type=FutureOr<bool?>?
type=FutureOr<bool?>
*/
switch (f3) {
/*space=true*/
@ -566,11 +566,11 @@ nonExhaustiveNullable(
break;
}
/*
checkingOrder={FutureOr<bool?>?,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
checkingOrder={FutureOr<bool?>,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
error=non-exhaustive:null,
expandedSubtypes={true,false,Null,Future<bool?>},
subtypes={FutureOr<bool?>,Null},
type=FutureOr<bool?>?
type=FutureOr<bool?>
*/
switch (f3) {
/*space=true*/
@ -587,11 +587,11 @@ nonExhaustiveNullable(
break;
}
/*
checkingOrder={FutureOr<bool?>?,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
checkingOrder={FutureOr<bool?>,FutureOr<bool?>,Null,bool?,Future<bool?>,bool,Null,true,false},
error=non-exhaustive:Future<bool?>(),
expandedSubtypes={true,false,Null,Future<bool?>},
subtypes={FutureOr<bool?>,Null},
type=FutureOr<bool?>?
type=FutureOr<bool?>
*/
switch (f3) {
/*space=true*/

View file

@ -14,16 +14,11 @@ membersMethod(o) {
type=Object?
*/
switch (o) {
Typedef(
:var hashCode
) /*cfe.space=FutureOr<dynamic>?(hashCode: int)*/ /*analyzer.space=FutureOr<dynamic>(hashCode: int)*/ =>
Typedef(:var hashCode) /*space=FutureOr<dynamic>(hashCode: int)*/ =>
hashCode,
Typedef(
:var runtimeType
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(runtimeType: Type)
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(runtimeType: Type)
*/
@ -31,10 +26,7 @@ membersMethod(o) {
runtimeType,
Typedef(
:var toString
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(toString: String Function())
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(toString: String Function())
*/
@ -42,10 +34,7 @@ membersMethod(o) {
toString(),
Typedef(
:var noSuchMethod
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(noSuchMethod: dynamic Function(Invocation))
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(noSuchMethod: dynamic Function(Invocation))
*/
@ -57,11 +46,11 @@ membersMethod(o) {
exhaustiveHashCode(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
fields={hashCode:int},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
@ -70,20 +59,18 @@ exhaustiveHashCode(Typedef o) {
type=FutureOr<dynamic>
*/
switch (o) {
Typedef(
:int hashCode
) /*cfe.space=FutureOr<dynamic>?(hashCode: int)*/ /*analyzer.space=FutureOr<dynamic>(hashCode: int)*/ =>
Typedef(:int hashCode) /*space=FutureOr<dynamic>(hashCode: int)*/ =>
hashCode,
};
}
exhaustiveRuntimeType(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
fields={runtimeType:Type},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
@ -92,20 +79,18 @@ exhaustiveRuntimeType(Typedef o) {
type=FutureOr<dynamic>
*/
switch (o) {
Typedef(
:Type runtimeType
) /*cfe.space=FutureOr<dynamic>?(runtimeType: Type)*/ /*analyzer.space=FutureOr<dynamic>(runtimeType: Type)*/ =>
Typedef(:Type runtimeType) /*space=FutureOr<dynamic>(runtimeType: Type)*/ =>
runtimeType,
};
}
exhaustiveToString(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
fields={toString:String Function()},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
@ -116,18 +101,18 @@ exhaustiveToString(Typedef o) {
switch (o) {
Typedef(
:String Function() toString
) /*cfe.space=FutureOr<dynamic>?(toString: String Function())*/ /*analyzer.space=FutureOr<dynamic>(toString: String Function())*/ =>
) /*space=FutureOr<dynamic>(toString: String Function())*/ =>
toString,
};
}
exhaustiveNoSuchMethod(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
@ -138,19 +123,19 @@ exhaustiveNoSuchMethod(Typedef o) {
switch (o) {
Typedef(
:dynamic Function(Invocation) noSuchMethod
) /*cfe.space=FutureOr<dynamic>?(noSuchMethod: dynamic Function(Invocation))*/ /*analyzer.space=FutureOr<dynamic>(noSuchMethod: dynamic Function(Invocation))*/ =>
) /*space=FutureOr<dynamic>(noSuchMethod: dynamic Function(Invocation))*/ =>
noSuchMethod,
};
}
nonExhaustiveRestrictedValue(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
error=non-exhaustive:Null(hashCode: int()),
expandedSubtypes={Object,Null,Future<dynamic>},
fields={hashCode:int},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
error=non-exhaustive:Future<dynamic>(hashCode: int()),
@ -160,21 +145,18 @@ nonExhaustiveRestrictedValue(Typedef o) {
type=FutureOr<dynamic>
*/
switch (o) {
Typedef(
hashCode: 5
) /*cfe.space=FutureOr<dynamic>?(hashCode: 5)*/ /*analyzer.space=FutureOr<dynamic>(hashCode: 5)*/ =>
5,
Typedef(hashCode: 5) /*space=FutureOr<dynamic>(hashCode: 5)*/ => 5,
};
}
nonExhaustiveRestrictedType(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
error=non-exhaustive:Null(noSuchMethod: dynamic Function(Invocation) _),
expandedSubtypes={Object,Null,Future<dynamic>},
fields={noSuchMethod:dynamic Function(Invocation)},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
error=non-exhaustive:Future<dynamic>(noSuchMethod: dynamic Function(Invocation) _),
@ -186,18 +168,18 @@ nonExhaustiveRestrictedType(Typedef o) {
switch (o) {
Typedef(
:int Function(Invocation) noSuchMethod
) /*cfe.space=FutureOr<dynamic>?(noSuchMethod: int Function(Invocation))*/ /*analyzer.space=FutureOr<dynamic>(noSuchMethod: int Function(Invocation))*/ =>
) /*space=FutureOr<dynamic>(noSuchMethod: int Function(Invocation))*/ =>
noSuchMethod,
};
}
unreachableMethod(Typedef o) {
return /*cfe.
checkingOrder={FutureOr<dynamic>?,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
checkingOrder={FutureOr<dynamic>,FutureOr<dynamic>,Null,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
fields={hashCode:int,noSuchMethod:dynamic Function(Invocation),runtimeType:Type,toString:String Function()},
subtypes={FutureOr<dynamic>,Null},
type=FutureOr<dynamic>?
type=FutureOr<dynamic>
*/ /*analyzer.
checkingOrder={FutureOr<dynamic>,Object?,Future<dynamic>,Object,Null},
expandedSubtypes={Object,Null,Future<dynamic>},
@ -206,16 +188,11 @@ unreachableMethod(Typedef o) {
type=FutureOr<dynamic>
*/
switch (o) {
Typedef(
:var hashCode
) /*cfe.space=FutureOr<dynamic>?(hashCode: int)*/ /*analyzer.space=FutureOr<dynamic>(hashCode: int)*/ =>
Typedef(:var hashCode) /*space=FutureOr<dynamic>(hashCode: int)*/ =>
hashCode,
Typedef(
:var runtimeType
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(runtimeType: Type)
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(runtimeType: Type)
*/
@ -223,10 +200,7 @@ unreachableMethod(Typedef o) {
runtimeType,
Typedef(
:var toString
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(toString: String Function())
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(toString: String Function())
*/
@ -234,10 +208,7 @@ unreachableMethod(Typedef o) {
toString(),
Typedef(
:var noSuchMethod
) /*cfe.
error=unreachable,
space=FutureOr<dynamic>?(noSuchMethod: dynamic Function(Invocation))
*/ /*analyzer.
) /*
error=unreachable,
space=FutureOr<dynamic>(noSuchMethod: dynamic Function(Invocation))
*/

View file

@ -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))
*/