@@ -33,7 +33,6 @@ import 'package:analyzer/src/diagnostic/diagnostic_factory.dart';
33
33
import 'package:analyzer/src/error/codes.dart' ;
34
34
import 'package:analyzer/src/generated/exhaustiveness.dart' ;
35
35
import 'package:analyzer/src/utilities/extensions/ast.dart' ;
36
- import 'package:analyzer/src/utilities/extensions/element.dart' ;
37
36
38
37
/// Instances of the class `ConstantVerifier` traverse an AST structure looking
39
38
/// for additional errors and warnings not covered by the parser and resolver.
@@ -213,11 +212,7 @@ class ConstantVerifier extends RecursiveAstVisitor<void> {
213
212
if (node.isConst) {
214
213
var constructor = node.constructorName.element;
215
214
if (constructor is ConstructorElementMixin2 ) {
216
- _validateConstructorInvocation (
217
- node,
218
- constructor.asElement,
219
- node.argumentList,
220
- );
215
+ _validateConstructorInvocation (node, constructor, node.argumentList);
221
216
}
222
217
} else {
223
218
super .visitDotShorthandConstructorInvocation (node);
@@ -288,7 +283,7 @@ class ConstantVerifier extends RecursiveAstVisitor<void> {
288
283
CompileTimeErrorCode .CONST_WITH_TYPE_PARAMETERS ,
289
284
);
290
285
291
- var constructor = node.constructorName.element? .asElement ;
286
+ var constructor = node.constructorName.element;
292
287
if (constructor != null ) {
293
288
_validateConstructorInvocation (node, constructor, node.argumentList);
294
289
}
@@ -916,7 +911,7 @@ class ConstantVerifier extends RecursiveAstVisitor<void> {
916
911
/// arguments are constant expressions.
917
912
void _validateConstructorInvocation (
918
913
AstNode node,
919
- ConstructorElementMixin constructor,
914
+ ConstructorElementMixin2 constructor,
920
915
ArgumentList argumentList,
921
916
) {
922
917
var constantVisitor = ConstantVisitor (
0 commit comments