@@ -340,7 +340,7 @@ class ConstantEvaluationEngine {
340340 Constant evaluateAndFormatErrorsInConstructorCall (
341341 LibraryElementImpl library,
342342 AstNode node,
343- List <DartType >? typeArguments,
343+ List <TypeImpl >? typeArguments,
344344 List <Expression > arguments,
345345 ConstructorElementMixin constructor,
346346 ConstantVisitor constantVisitor, {
@@ -385,7 +385,7 @@ class ConstantEvaluationEngine {
385385 Constant evaluateConstructorCall (
386386 LibraryElementImpl library,
387387 AstNode node,
388- List <DartType >? typeArguments,
388+ List <TypeImpl >? typeArguments,
389389 List <Expression > arguments,
390390 ConstructorElementMixin constructor,
391391 ConstantVisitor constantVisitor, {
@@ -544,7 +544,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
544544 final Map <String , DartObjectImpl >? _lexicalEnvironment;
545545
546546 /// A mapping of type parameter names to runtime values (types).
547- final Map <TypeParameterElement , DartType >? _lexicalTypeEnvironment;
547+ final Map <TypeParameterElement , TypeImpl >? _lexicalTypeEnvironment;
548548
549549 final Substitution ? _substitution;
550550
@@ -567,7 +567,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
567567 this ._library,
568568 this ._errorReporter, {
569569 Map <String , DartObjectImpl >? lexicalEnvironment,
570- Map <TypeParameterElement , DartType >? lexicalTypeEnvironment,
570+ Map <TypeParameterElement , TypeImpl >? lexicalTypeEnvironment,
571571 Substitution ? substitution,
572572 }) : _lexicalEnvironment = lexicalEnvironment,
573573 _lexicalTypeEnvironment = lexicalTypeEnvironment,
@@ -815,7 +815,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
815815 return InvalidConstant .forEntity (
816816 node, CompileTimeErrorCode .INVALID_CONSTANT );
817817 }
818- var classType = constructorFunctionType.returnType as InterfaceType ;
818+ var classType = constructorFunctionType.returnType as InterfaceTypeImpl ;
819819 var typeArguments = classType.typeArguments;
820820 // The result is already instantiated during resolution;
821821 // [_dartObjectComputer.typeInstantiate] is unnecessary.
@@ -858,7 +858,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
858858 }
859859
860860 @override
861- Constant visitFunctionReference (FunctionReference node) {
861+ Constant visitFunctionReference (covariant FunctionReferenceImpl node) {
862862 var functionResult = evaluateConstant (node.function);
863863 if (functionResult is ! DartObjectImpl ) {
864864 return functionResult;
@@ -890,7 +890,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
890890 return _instantiateFunctionType (node, functionResult);
891891 }
892892
893- var typeArguments = < DartType > [];
893+ var typeArguments = < TypeImpl > [];
894894 for (var typeArgument in typeArgumentList.arguments) {
895895 var typeArgumentConstant = evaluateConstant (typeArgument);
896896 switch (typeArgumentConstant) {
@@ -920,7 +920,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
920920 }
921921
922922 @override
923- Constant visitGenericFunctionType (GenericFunctionType node) {
923+ Constant visitGenericFunctionType (covariant GenericFunctionTypeImpl node) {
924924 return DartObjectImpl (
925925 typeSystem,
926926 _typeProvider.typeType,
@@ -1108,7 +1108,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
11081108 evaluateConstant (node.expression);
11091109
11101110 @override
1111- Constant visitPrefixedIdentifier (PrefixedIdentifier node) {
1111+ Constant visitPrefixedIdentifier (covariant PrefixedIdentifierImpl node) {
11121112 var prefixNode = node.prefix;
11131113 var prefixElement = prefixNode.staticElement;
11141114
@@ -1177,10 +1177,10 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
11771177 }
11781178
11791179 @override
1180- Constant visitPropertyAccess (PropertyAccess node) {
1180+ Constant visitPropertyAccess (covariant PropertyAccessImpl node) {
11811181 var target = node.target;
11821182 if (target != null ) {
1183- if (target is PrefixedIdentifier &&
1183+ if (target is PrefixedIdentifierImpl &&
11841184 (target.staticElement is ExtensionElement ||
11851185 target.staticElement is ExtensionTypeElement )) {
11861186 var prefix = target.prefix;
@@ -1247,7 +1247,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
12471247 }
12481248
12491249 @override
1250- Constant ? visitRecordTypeAnnotation (RecordTypeAnnotation node) {
1250+ Constant ? visitRecordTypeAnnotation (covariant RecordTypeAnnotationImpl node) {
12511251 return DartObjectImpl (
12521252 typeSystem,
12531253 _typeProvider.typeType,
@@ -1307,7 +1307,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
13071307 }
13081308
13091309 @override
1310- Constant visitSimpleIdentifier (SimpleIdentifier node) {
1310+ Constant visitSimpleIdentifier (covariant SimpleIdentifierImpl node) {
13111311 var value = _lexicalEnvironment? [node.name];
13121312 if (value != null ) {
13131313 return _instantiateFunctionTypeForSimpleIdentifier (node, value);
@@ -1727,9 +1727,9 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
17271727 Constant _getConstantValue ({
17281728 required AstNode errorNode,
17291729 required Expression ? expression,
1730- required SimpleIdentifier ? identifier,
1730+ required SimpleIdentifierImpl ? identifier,
17311731 required Element ? element,
1732- DartType ? givenType,
1732+ TypeImpl ? givenType,
17331733 }) {
17341734 var errorNode2 = _evaluationEngine.configuration.errorNode (errorNode);
17351735 element = element? .declaration;
@@ -1795,7 +1795,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
17951795 }
17961796 return _instantiateFunctionTypeForSimpleIdentifier (identifier, rawType);
17971797 }
1798- } else if (variableElement is InterfaceElement ) {
1798+ } else if (variableElement is InterfaceElementImpl ) {
17991799 var type = givenType ??
18001800 variableElement.instantiate (
18011801 typeArguments: variableElement.typeParameters
@@ -1814,7 +1814,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
18141814 _typeProvider.typeType,
18151815 TypeState (_typeProvider.dynamicType),
18161816 );
1817- } else if (variableElement is TypeAliasElement ) {
1817+ } else if (variableElement is TypeAliasElementImpl ) {
18181818 var type = givenType ??
18191819 variableElement.instantiate (
18201820 typeArguments: variableElement.typeParameters
@@ -1928,7 +1928,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
19281928 /// argument types, returns [value] type-instantiated with those [node] 's
19291929 /// type argument types, otherwise returns [value] .
19301930 DartObjectImpl _instantiateFunctionType (
1931- FunctionReference node, DartObjectImpl value) {
1931+ FunctionReferenceImpl node, DartObjectImpl value) {
19321932 var functionElement = value.toFunctionValue ();
19331933 if (functionElement is ! ExecutableElementOrMember ) {
19341934 return value;
@@ -1956,7 +1956,7 @@ class ConstantVisitor extends UnifyingAstVisitor<Constant> {
19561956 /// type-instantiated with those [node] 's tear-off type argument types,
19571957 /// otherwise returns [value] .
19581958 Constant _instantiateFunctionTypeForSimpleIdentifier (
1959- SimpleIdentifier node, DartObjectImpl value) {
1959+ SimpleIdentifierImpl node, DartObjectImpl value) {
19601960 // TODO(srawlins): When all code uses [FunctionReference]s generated via
19611961 // generic function instantiation, remove this method and all call sites.
19621962 var functionElement = value.toFunctionValue ();
@@ -2298,7 +2298,7 @@ class DartObjectComputer {
22982298
22992299 Constant typeInstantiate (
23002300 DartObjectImpl function,
2301- List <DartType > typeArguments,
2301+ List <TypeImpl > typeArguments,
23022302 Expression node,
23032303 TypeArgumentList typeArgumentsErrorNode,
23042304 ) {
@@ -2430,7 +2430,7 @@ class _InstanceCreationEvaluator {
24302430
24312431 final ConstructorElementMixin _constructor;
24322432
2433- final List <DartType >? _typeArguments;
2433+ final List <TypeImpl >? _typeArguments;
24342434
24352435 final ConstructorInvocation _invocation;
24362436
@@ -2440,7 +2440,7 @@ class _InstanceCreationEvaluator {
24402440
24412441 final List <DartObjectImpl > _argumentValues;
24422442
2443- final Map <TypeParameterElement , DartType > _typeParameterMap = HashMap ();
2443+ final Map <TypeParameterElement , TypeImpl > _typeParameterMap = HashMap ();
24442444
24452445 final Map <String , DartObjectImpl > _parameterMap = HashMap ();
24462446
@@ -3056,7 +3056,7 @@ class _InstanceCreationEvaluator {
30563056 LibraryElementImpl library,
30573057 AstNode node,
30583058 ConstructorElementMixin constructor,
3059- List <DartType >? typeArguments,
3059+ List <TypeImpl >? typeArguments,
30603060 List <Expression > arguments,
30613061 ConstantVisitor constantVisitor, {
30623062 ConstructorInvocation ? invocation,
0 commit comments