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

Unified Diff: tests/language/final_initializer_instance_reference_test.dart

Issue 2230853002: Ensure correct current element for field initializers. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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/compiler/lib/src/resolution/resolution.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/final_initializer_instance_reference_test.dart
diff --git a/tests/language/conflicting_type_variable_and_setter_test.dart b/tests/language/final_initializer_instance_reference_test.dart
similarity index 52%
copy from tests/language/conflicting_type_variable_and_setter_test.dart
copy to tests/language/final_initializer_instance_reference_test.dart
index 2aca0c32b659b1f1f213c4744ab50c6753befbbc..65580e778d50a0ee3c60f1732a353617105fc898 100644
--- a/tests/language/conflicting_type_variable_and_setter_test.dart
+++ b/tests/language/final_initializer_instance_reference_test.dart
@@ -2,18 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import "package:expect/expect.dart";
+// Dart2js regression test. Error in initializer might be report with the wrong
+// current element.
-class C<D> {
- void set D(int value) {
- field = value;
- }
+class C {
+ const C();
- int field;
+ final x = 1;
+ final y = x; /// 01: compile-time error
}
main() {
- C<int> c = new C<int>();
- c.D = 1;
- Expect.equals(c.field, 1);
+ const C().y; /// 01: continued
}
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698