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); |
+} |