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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1168563004: Fix a corner case of constant constructor dependency computation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « pkg/analyzer/lib/src/generated/constant.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 4036ee2f1e26428930c9095736faf6385fa61035..cfbfc2e06cd2308d37125ff33969a5cedc7348e0 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -1495,6 +1495,21 @@ const d = a;
''');
}
+ test_const_constructor_calls_implicit_super_constructor_implicitly() {
+ // Note: the situation below is a compile-time error (since the synthetic
+ // constructor for Base is non-const), but we need to handle it without
+ // throwing an exception.
+ EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
+ 'x', '''
+class Base {}
+class Derived extends Base {
+ const Derived();
+}
+const x = const Derived();
+''');
+ expect(evaluationResult, isNotNull);
+ }
+
test_dependency() {
EvaluationResultImpl evaluationResult = _computeTopLevelVariableConstValue(
'x', '''
« no previous file with comments | « pkg/analyzer/lib/src/generated/constant.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698