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

Unified Diff: tests/language_strong/abstract_getter2_test.dart

Issue 2571363002: fixes #27385, implement virtual fields in DDC (Closed)
Patch Set: format Created 4 years 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: tests/language_strong/abstract_getter2_test.dart
diff --git a/tests/language_strong/abstract_getter2_test.dart b/tests/language_strong/abstract_getter2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9553ba4987958ad6aaaede9820203f477fe832a9
--- /dev/null
+++ b/tests/language_strong/abstract_getter2_test.dart
@@ -0,0 +1,27 @@
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
+// 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";
+
+class A {
+ int get x => 100;
+}
+
+abstract class B extends A {
+ int _x;
+
+ int get x;
+ set x(int v) { _x = v; }
+}
+
+class C extends B {
+ int get x => super.x;
+}
+
+void main() {
+ B b = new C();
+ b.x = 42;
+ Expect.equals(b._x, 42);
+ Expect.equals(b.x, 100);
+}
« no previous file with comments | « pkg/dev_compiler/test/not_yet_strong_tests.dart ('k') | tests/language_strong/closure_with_super_field_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698