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

Side by Side Diff: tests/language/regress_26133_test.dart

Issue 1847953002: Report wrong async function result type as type error in checked mode (Fixes #26133). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comment 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 unified diff | Download patch
« no previous file with comments | « tests/language/language_dart2js.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) 2016, 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 main() {
25 foo().then(
26 (_) {
27 Expect.isFalse(isCheckedMode());
28 },
29 onError: (e) {
30 Expect.isTrue(isCheckedMode() && (e is TypeError));
31 }
32 );
33 }
34
OLDNEW
« no previous file with comments | « tests/language/language_dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698