@@ -9,7 +9,7 @@ import 'package:_fe_analyzer_shared/src/testing/id_testing.dart';
99import 'package:analyzer/dart/analysis/features.dart' ;
1010import 'package:analyzer/dart/ast/ast.dart' ;
1111import 'package:analyzer/dart/constant/value.dart' ;
12- import 'package:analyzer/dart/element/element .dart' ;
12+ import 'package:analyzer/dart/element/element2 .dart' ;
1313import 'package:analyzer/dart/element/type.dart' ;
1414import 'package:analyzer/error/error.dart' ;
1515import 'package:analyzer/src/dart/analysis/experiments.dart' ;
@@ -58,8 +58,8 @@ class ConstantsDataComputer extends DataComputer<String> {
5858 @override
5959 void computeUnitData (TestingData testingData, CompilationUnit unit,
6060 Map <Id , ActualData <String >> actualMap) {
61- ConstantsDataExtractor ( unit.declaredElement ! .source.uri, actualMap)
62- .run (unit);
61+ var unitUri = unit.declaredFragment ! .source.uri;
62+ ConstantsDataExtractor (unitUri, actualMap) .run (unit);
6363 }
6464}
6565
@@ -69,9 +69,9 @@ class ConstantsDataExtractor extends AstDataExtractor<String> {
6969 @override
7070 String ? computeNodeValue (Id id, AstNode node) {
7171 if (node is Identifier ) {
72- var element = node.staticElement ;
73- if (element is PropertyAccessorElement && element.isSynthetic) {
74- var variable = element.variable2 ! ;
72+ var element = node.element ;
73+ if (element is PropertyAccessorElement2 && element.isSynthetic) {
74+ var variable = element.variable3 ! ;
7575 if (! variable.isSynthetic && variable.isConst) {
7676 var value = variable.computeConstantValue ();
7777 if (value != null ) return _stringify (value);
@@ -116,8 +116,8 @@ class ConstantsDataExtractor extends AstDataExtractor<String> {
116116 }
117117 // TODO(paulberry): Support object constants.
118118 } else if (type is FunctionType ) {
119- var element = value.toFunctionValue ()! ;
120- return 'Function(${element .name },type=${_stringifyType (value .type !)})' ;
119+ var element = value.toFunctionValue2 ()! ;
120+ return 'Function(${element .name3 },type=${_stringifyType (value .type !)})' ;
121121 }
122122 throw UnimplementedError ('_stringify for type $type ' );
123123 }
0 commit comments