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

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

Issue 3000743002: Check for null constructor field initializer expression. (Closed)
Patch Set: Check for null in ConstantEvaluationEngine instead. Created 3 years, 4 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/dart/constant/evaluation.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/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 d8b1513efbc4b68be6c0ba75becf16b37d85ec09..5158c9070561ecbc4d13a94a87a9597667ed963d 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -881,6 +881,21 @@ foo(var p) {
verify([source]);
}
+ test_const_invalid_constructorFieldInitializer_fromLibrary() async {
+ addNamedSource('/lib.dart', r'''
+class A<T> {
+ final int f;
+ const A() : f = T.foo;
+}
+''');
+ Source source = addSource(r'''
+import 'lib.dart';
+const a = const A();
+''');
+ await computeAnalysisResult(source);
+ assertErrors(source, [CompileTimeErrorCode.CONST_EVAL_THROWS_EXCEPTION]);
+ }
+
test_constConstructor_redirect_generic() async {
Source source = addSource(r'''
class A<T> {
« no previous file with comments | « pkg/analyzer/lib/src/dart/constant/evaluation.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698