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

Unified Diff: tests/language_strong/super_tearoff_test.dart

Issue 2944003003: Fixes for super tearoff in constructor (Closed)
Patch Set: Created 3 years, 6 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/language_strong/super_tearoff_test.dart
diff --git a/tests/language_strong/super_tearoff_test.dart b/tests/language_strong/super_tearoff_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..56f0a311b218f04f4d61d00b4e68da196a58b6c7
--- /dev/null
+++ b/tests/language_strong/super_tearoff_test.dart
@@ -0,0 +1,26 @@
+import 'package:expect/expect.dart';
Jennifer Messerly 2017/06/19 20:24:52 this needs a copyright notice alternatively, I th
vsm 2017/06/19 20:36:20 Done.
+
+int invoke(int f()) => f();
+
+class A {
+ int foo() {
+ return 42;
+ }
+}
+
+class B extends A {
+ int x;
+
+ B() {
+ x = invoke(super.foo);
+ }
+
+ int foo() {
+ return -1;
+ }
+}
+
+void main() {
+ var b = new B();
+ Expect.equals(42, b.x);
+}

Powered by Google App Engine
This is Rietveld 408576698