Index: pkg/analyzer/test/generated/compile_time_error_code_test.dart |
diff --git a/pkg/analyzer/test/generated/compile_time_error_code_test.dart b/pkg/analyzer/test/generated/compile_time_error_code_test.dart |
index 9c871e6fbe1a673ba83594d3c0198898965981b3..955a900fe573c26dacd68864b30c1c056b24eff2 100644 |
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart |
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart |
@@ -1260,6 +1260,25 @@ class A { |
verify([source]); |
} |
+ test_nonConstValueInInitializer_instanceCreation_inDifferentFile() async { |
+ resetWith(options: new AnalysisOptionsImpl()..strongMode = true); |
+ Source source = addNamedSource( |
+ '/a.dart', |
+ r''' |
+import 'b.dart'; |
+const v = const MyClass(); |
+'''); |
+ addNamedSource( |
+ '/b.dart', |
+ r''' |
+class MyClass { |
+ const MyClass([p = foo]); |
+} |
+'''); |
+ await computeAnalysisResult(source); |
+ assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]); |
+ } |
+ |
test_constInitializedWithNonConstValue() async { |
Source source = addSource(r''' |
f(p) { |
@@ -4774,12 +4793,10 @@ class B { |
final a; |
} |
var b = const B();'''); |
- // TODO(paulberry): the error INVALID_CONSTAT is redundant and ought to be |
- // suppressed. |
await computeAnalysisResult(source); |
assertErrors(source, [ |
CompileTimeErrorCode.NON_CONSTANT_VALUE_IN_INITIALIZER, |
- CompileTimeErrorCode.INVALID_CONSTANT |
+ CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION |
Brian Wilkerson
2017/04/18 18:53:21
Seems like we still have redundant errors and ough
scheglov
2017/04/18 19:11:03
I'm restoring it (because removing it later is eas
|
]); |
verify([source]); |
} |