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

Side by Side Diff: tests/language_2/regress_30339_test.dart

Issue 2993223002: [VM parser] Insert missing result type check in async functions using arrow (Closed)
Patch Set: update status file Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « tests/language_2/language_2_kernel.status ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6 import 'package:expect/expect.dart';
7
8 isCheckedMode() {
9 try {
10 var i = 1;
11 String s = i;
12 return false;
13 } on TypeError {
14 return true;
15 }
16 }
17
18 var x = 'a';
19
20 Future<int> foo() async {
21 return x;
22 }
23
24 Future<int> bar() async => x;
25
26 main() {
27 foo().then((_) {
28 Expect.isFalse(isCheckedMode());
29 }, onError: (e) {
30 Expect.isTrue(isCheckedMode() && (e is TypeError));
31 });
32 bar().then((_) {
33 Expect.isFalse(isCheckedMode());
34 }, onError: (e) {
35 Expect.isTrue(isCheckedMode() && (e is TypeError));
36 });
37 }
OLDNEW
« no previous file with comments | « tests/language_2/language_2_kernel.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698