@@ -309,7 +309,7 @@ class TypeVariableTests {
309309 ///
310310 void registerDependencies (RtiNode node, DartType type) {
311311 type.forEachTypeVariable ((TypeVariableType typeVariable) {
312- final typeDeclaration = typeVariable.element.typeDeclaration! ;
312+ final typeDeclaration = typeVariable.element.typeDeclaration;
313313 if (typeDeclaration is ClassEntity ) {
314314 node.addDependency (_getClassNode (typeDeclaration));
315315 } else {
@@ -326,7 +326,7 @@ class TypeVariableTests {
326326 }
327327
328328 void onTypeVariable (TypeVariableType type) {
329- final declaration = type.element.typeDeclaration! ;
329+ final declaration = type.element.typeDeclaration;
330330 if (declaration is ClassEntity ) {
331331 node.addDependency (_getClassNode (declaration));
332332 } else {
@@ -470,7 +470,7 @@ class TypeVariableTests {
470470 void _propagateTests () {
471471 void processTypeVariableType (TypeVariableType type) {
472472 TypeVariableEntity variable = type.element;
473- final typeDeclaration = variable.typeDeclaration! ;
473+ final typeDeclaration = variable.typeDeclaration;
474474 if (typeDeclaration is ClassEntity ) {
475475 _getClassNode (typeDeclaration).markTest ();
476476 } else {
@@ -552,7 +552,7 @@ class TypeVariableTests {
552552
553553 void _addImplicitChecksViaInstantiation (TypeVariableType variable) {
554554 TypeVariableEntity entity = variable.element;
555- final declaration = entity.typeDeclaration! ;
555+ final declaration = entity.typeDeclaration;
556556 if (declaration is ClassEntity ) {
557557 classInstantiationsOf (declaration).forEach ((InterfaceType type) {
558558 _addImplicitCheck (type.typeArguments[entity.index]);
@@ -965,7 +965,6 @@ class RuntimeTypesNeedBuilderImpl implements RuntimeTypesNeedBuilder {
965965 @override
966966 void registerTypeVariableLiteral (TypeVariableType variable) {
967967 final typeDeclaration = variable.element.typeDeclaration;
968- assert (typeDeclaration != null );
969968 if (typeDeclaration is ClassEntity ) {
970969 registerClassUsingTypeVariableLiteral (typeDeclaration);
971970 } else if (typeDeclaration is FunctionEntity ) {
@@ -1060,7 +1059,7 @@ class RuntimeTypesNeedBuilderImpl implements RuntimeTypesNeedBuilder {
10601059 potentiallyNeedTypeArguments (function);
10611060 }
10621061 functionType.forEachTypeVariable ((TypeVariableType typeVariable) {
1063- final typeDeclaration = typeVariable.element.typeDeclaration! ;
1062+ final typeDeclaration = typeVariable.element.typeDeclaration;
10641063 if (! processedEntities.contains (typeDeclaration)) {
10651064 potentiallyNeedTypeArguments (typeDeclaration);
10661065 }
@@ -1100,7 +1099,7 @@ class RuntimeTypesNeedBuilderImpl implements RuntimeTypesNeedBuilder {
11001099 type.forEachTypeVariable ((TypeVariableType typeVariable) {
11011100 // This handles checks against type variables and function types
11021101 // containing type variables.
1103- final typeDeclaration = typeVariable.element.typeDeclaration! ;
1102+ final typeDeclaration = typeVariable.element.typeDeclaration;
11041103 potentiallyNeedTypeArguments (typeDeclaration);
11051104 });
11061105 if (type is FunctionType ) {
@@ -1295,7 +1294,7 @@ class RuntimeTypesNeedBuilderImpl implements RuntimeTypesNeedBuilder {
12951294 FunctionType functionType =
12961295 _elementEnvironment.getLocalFunctionType (function);
12971296 functionType.forEachTypeVariable ((TypeVariableType typeVariable) {
1298- final typeDeclaration = typeVariable.element.typeDeclaration! ;
1297+ final typeDeclaration = typeVariable.element.typeDeclaration;
12991298 if (! processedEntities.contains (typeDeclaration)) {
13001299 potentiallyNeedTypeArguments (typeDeclaration);
13011300 }
0 commit comments