Index: pkg/analyzer/lib/src/generated/constant.dart |
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart |
index f2a8c962e548172dab6a13900c85a36b60ca27d2..006d3a901e2e121d0f794957975e812d04433bfe 100644 |
--- a/pkg/analyzer/lib/src/generated/constant.dart |
+++ b/pkg/analyzer/lib/src/generated/constant.dart |
@@ -6,8 +6,11 @@ library analyzer.src.generated.constant; |
import 'dart:collection'; |
+import 'package:analyzer/dart/element/element.dart'; |
+import 'package:analyzer/dart/element/type.dart'; |
+import 'package:analyzer/src/dart/element/element.dart'; |
+import 'package:analyzer/src/dart/element/member.dart'; |
import 'package:analyzer/src/generated/ast.dart'; |
-import 'package:analyzer/src/generated/element.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/engine.dart' |
show AnalysisEngine, RecordingErrorListener; |
@@ -714,7 +717,8 @@ class ConstantEvaluationEngine { |
DartObjectImpl fieldValue = evaluationResult.value; |
if (fieldValue != null && !runtimeTypeMatch(fieldValue, fieldType)) { |
errorReporter.reportErrorForNode( |
- CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, |
+ CheckedModeCompileTimeErrorCode |
+ .CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, |
node, |
[fieldValue.type, field.name, fieldType]); |
} |
@@ -762,7 +766,8 @@ class ConstantEvaluationEngine { |
if (argumentValue != null) { |
if (!runtimeTypeMatch(argumentValue, parameter.type)) { |
errorReporter.reportErrorForNode( |
- CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, |
+ CheckedModeCompileTimeErrorCode |
+ .CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, |
errorTarget, |
[argumentValue.type, parameter.type]); |
} |
@@ -776,7 +781,8 @@ class ConstantEvaluationEngine { |
// the field. |
if (!runtimeTypeMatch(argumentValue, fieldType)) { |
errorReporter.reportErrorForNode( |
- CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, |
+ CheckedModeCompileTimeErrorCode |
+ .CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH, |
errorTarget, |
[argumentValue.type, fieldType]); |
} |
@@ -818,7 +824,8 @@ class ConstantEvaluationEngine { |
PropertyInducingElement field = getter.variable; |
if (!runtimeTypeMatch(evaluationResult, field.type)) { |
errorReporter.reportErrorForNode( |
- CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, |
+ CheckedModeCompileTimeErrorCode |
+ .CONST_CONSTRUCTOR_FIELD_TYPE_MISMATCH, |
node, |
[evaluationResult.type, fieldName, field.type]); |
} |
@@ -992,7 +999,8 @@ class ConstantEvaluationEngine { |
* Determine whether the given string is a valid name for a public symbol |
* (i.e. whether it is allowed for a call to the Symbol constructor). |
*/ |
- static bool isValidPublicSymbol(String name) => name.isEmpty || |
+ static bool isValidPublicSymbol(String name) => |
+ name.isEmpty || |
name == "void" || |
new JavaPatternMatcher(_PUBLIC_SYMBOL_PATTERN, name).matches(); |