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

Unified Diff: test/codegen/language/super_in_async2_test.dart

Issue 1948563002: allow 'super' in async and finally blocks (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 7 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/language/super_in_async1_test.dart ('k') | test/codegen/language/super_in_async3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/language/super_in_async2_test.dart
diff --git a/test/codegen/language/generic_async_star_test.dart b/test/codegen/language/super_in_async2_test.dart
similarity index 58%
copy from test/codegen/language/generic_async_star_test.dart
copy to test/codegen/language/super_in_async2_test.dart
index cf18af84924948a71e6e6420322cdd082319b6b7..403a1943192229ad04fd49648553435218f55cf9 100644
--- a/test/codegen/language/generic_async_star_test.dart
+++ b/test/codegen/language/super_in_async2_test.dart
@@ -6,14 +6,18 @@ import "package:expect/expect.dart";
import 'dart:async';
-Stream/*<T>*/ foo/*<T>*/(/*=T*/ x) async* {
- for (int i = 0; i < 3; i++) {
- yield x;
- }
+class A {
+ Future<int> foo() async => 42;
}
-main() async {
- await for (var x in foo/*<int>*/(1)) {
- Expect.equals(1, x);
+class B extends A {
+ Future<int> foo() async {
+ var x = await super.foo();
+ var y = await super.foo();
+ return x + y;
}
}
+
+main() async {
+ Expect.equals(84, await new B().foo());
+}
« no previous file with comments | « test/codegen/language/super_in_async1_test.dart ('k') | test/codegen/language/super_in_async3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698