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

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

Issue 1416873003: Rework handling of potentially-constant variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/element.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 2028e70a038534e5887dd66b1d18cfca96545ccf..743399e0a9a458a8df5142dfc746d3127cdc64f5 100644
--- a/pkg/analyzer/test/generated/compile_time_error_code_test.dart
+++ b/pkg/analyzer/test/generated/compile_time_error_code_test.dart
@@ -1009,6 +1009,20 @@ const x = const A();''');
verify([source]);
}
+ void test_constEval_nonStaticField_inGenericClass() {
+ Source source = addSource('''
+class C<T> {
+ const C();
+ T get t => null;
+}
+
+const x = const C().t;''');
+ computeLibrarySourceErrors(source);
+ assertErrors(source,
+ [CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE]);
+ verify([source]);
+ }
+
void test_constEval_propertyExtraction_targetNotConst() {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/lib/src/generated/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698