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

Unified Diff: pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart

Issue 2825813002: Issue 29358. Fix for reporting constant errors while evaluating constructor invocations. (Closed)
Patch Set: Restore TODO. Created 3 years, 8 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
Index: pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
diff --git a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
index 6a7256c451b6760aa28d40c98fe80282fe68c1bd..fa24d557e3832e11cf7ea561757b646a17e209bd 100644
--- a/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/checked_mode_compile_time_error_code_test.dart
@@ -575,9 +575,25 @@ class A {
}
var v = const A.a1(0);''');
await computeAnalysisResult(source);
- assertErrors(source, [
- CheckedModeCompileTimeErrorCode.CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH
- ]);
+ assertErrors(
+ source, [CheckedModeCompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+ verify([source]);
+ }
+
+ test_superConstructor_paramTypeMismatch() async {
+ Source source = addSource(r'''
+class C {
+ final double d;
+ const C(this.d);
+}
+class D extends C {
+ const D(d) : super(d);
+}
+const f = const D(0);
+''');
+ await computeAnalysisResult(source);
+ assertErrors(
+ source, [CheckedModeCompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
verify([source]);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/test/generated/compile_time_error_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698