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

Unified Diff: test/codegen/fields.dart

Issue 1093143004: fixes #52, fields shadowing getters/setters or other fields (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
« no previous file with comments | « test/codegen/expect/temps.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/fields.dart
diff --git a/test/codegen/fields.dart b/test/codegen/fields.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b9f934bd6438ecc50f7503ba2ae3193da882209f
--- /dev/null
+++ b/test/codegen/fields.dart
@@ -0,0 +1,45 @@
+// Copyright (c) 2015, 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.
+
+library fields;
+
+init(x) {
+ print(x);
+ return x;
+}
+
+class Base {
+ var x = init('Base.x');
+}
+class Mixin1 {
+ var x = init('Mixin1.x');
+}
+class Mixin2 {
+ var x = init('Mixin2.x');
+}
+class Derived extends Base with Mixin1, Mixin2 {
+ var x = init('Derived.x');
+}
+
+// Private within the same library also needs this treatment.
+class _Base {
+ var x = init('_Base.x');
+}
+class _Mixin1 {
+ var _x = init('_Mixin1.x');
+}
+class _Mixin2 {
+ var _x = init('_Mixin2.x');
+}
+class _Derived extends _Base with _Mixin1, _Mixin2 {
+ var _x = init('_Derived.x');
+}
+
+
+main() {
+ print('Creating Derived');
+ print('Derived.x == ' + new Derived().x);
+ print('Creating _Derived');
+ print('_Derived.x == ' + new _Derived()._x);
+}
« no previous file with comments | « test/codegen/expect/temps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698