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

Unified Diff: tests/kernel/unsorted/super_mixin_test.dart

Issue 2434123003: Merge more Kernel infrastructure from kernel_sdk SDK fork. (Closed)
Patch Set: Created 4 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
Index: tests/kernel/unsorted/super_mixin_test.dart
diff --git a/tests/kernel/unsorted/super_mixin_test.dart b/tests/kernel/unsorted/super_mixin_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..ed6ac39edf9fc03944b9b340dc201c9754afe1ac
--- /dev/null
+++ b/tests/kernel/unsorted/super_mixin_test.dart
@@ -0,0 +1,35 @@
+import 'expect.dart';
Kevin Millikin (Google) 2016/10/21 09:10:58 Copyright header.
Vyacheslav Egorov (Google) 2016/10/21 13:39:43 Done.
+
+class Base {
+ var field;
+
+ method(x) {
+ print(x);
+ return x;
+ }
+
+ set setter(x) {
+ print(x);
+ field = x;
+ }
+}
+
+class Mixin {
+ method(x) {
+ return super.method(x + 'Mixin');
+ }
+
+ set setter(x) {
+ super.setter = x + 'Mixin';
+ }
+}
+
+class Sub extends Base with Mixin {
+}
+
+main() {
+ var object = new Sub();
+ Expect.isTrue(object.method('x') == 'xMixin');
+ object.setter = 'y';
+ Expect.isTrue(object.field == 'yMixin');
+}

Powered by Google App Engine
This is Rietveld 408576698