Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1101)

Unified Diff: pkg/analyzer/lib/src/generated/constant.dart

Issue 1145913002: In constant evaluation, handle annotation referring to non-const constructor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fccd3603022149198b4aa8e59984f903f06ca8ad..379b4ad972a351b43a8f4daf3e3a6cf6f16d93a2 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -370,7 +370,7 @@ class ConstantEvaluationEngine {
VariableElementImpl variableElement =
element.variable as VariableElementImpl;
elementAnnotation.evaluationResult = variableElement.evaluationResult;
- } else if (element is ConstructorElementImpl &&
+ } else if (element is ConstructorElementImpl && element.isConst &&
constNode.arguments != null) {
RecordingErrorListener errorListener = new RecordingErrorListener();
CompilationUnit sourceCompilationUnit =
@@ -485,8 +485,6 @@ class ConstantEvaluationEngine {
} else if (element is ConstructorElementImpl && element.isConst) {
// The annotation is a constructor invocation, so it depends on the
// constructor.
- // TODO(paulberry): make sure the right thing happens if the
- // constructor is non-const.
callback(element);
} else {
// This could happen in the event of invalid code. The error will be
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698