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 9cf3a6cc1fd2003759b35ff8f137e0d608bfd392..6e157fccf8bde622fe464829ccaaa0b492e1ca0f 100644 |
--- a/pkg/analyzer/lib/src/generated/constant.dart |
+++ b/pkg/analyzer/lib/src/generated/constant.dart |
@@ -747,6 +747,10 @@ class ConstantEvaluationEngine { |
} |
} |
String fieldName = field.name; |
+ if (fieldMap.containsKey(fieldName)) { |
+ errorReporter.reportErrorForNode( |
+ CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node); |
+ } |
fieldMap[fieldName] = argumentValue; |
} |
} else { |
@@ -768,6 +772,10 @@ class ConstantEvaluationEngine { |
initializerExpression.accept(initializerVisitor); |
if (evaluationResult != null) { |
String fieldName = constructorFieldInitializer.fieldName.name; |
+ if (fieldMap.containsKey(fieldName)) { |
+ errorReporter.reportErrorForNode( |
+ CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION, node); |
+ } |
fieldMap[fieldName] = evaluationResult; |
PropertyAccessorElement getter = definingClass.getGetter(fieldName); |
if (getter != null) { |