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

Unified Diff: frog/tests/leg_only/src/SuperCallTest.dart

Issue 9166010: Implement super calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 11 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: frog/tests/leg_only/src/SuperCallTest.dart
diff --git a/frog/tests/leg_only/src/SuperCallTest.dart b/frog/tests/leg_only/src/SuperCallTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..85ad2bec581dbd88107817013ab16de12b293e90
--- /dev/null
+++ b/frog/tests/leg_only/src/SuperCallTest.dart
@@ -0,0 +1,17 @@
+class A {
+ foo() => "A.foo" + baz();
+ baz() => "A.baz";
+ hest(String s, int i) => s + i;
+}
+
+class B extends A {
+ foo() => "B.foo" + super.foo();
+ baz() => "B.baz";
+ hest(s, i) => "B.hest" + super.hest(s, i);
+}
+
+main() {
+ B b = new B();
+ Expect.equals("B.fooA.fooB.baz", b.foo());
+ Expect.equals("B.hestfisk42", b.hest('fisk', 42));
+}

Powered by Google App Engine
This is Rietveld 408576698