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

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

Issue 11361060: Support checked mode for return type. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/return_in_loop_test.dart ('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) 2012, 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 isCheckedMode() {
6 try {
7 var i = 1;
8 String s = i;
9 return false;
10 } catch (e) {
11 return true;
12 }
13 }
14
15 int returnString1() => 's';
16 void returnNull() => null;
17 void returnString2() => 's';
18
19 main() {
20 if (isCheckedMode()) {
21 Expect.throws(returnString1, (e) => e is TypeError);
22 Expect.throws(returnString2, (e) => e is TypeError);
23 returnNull();
24 } else {
25 returnString1();
26 returnNull();
27 returnString2();
28 }
29 }
OLDNEW
« no previous file with comments | « tests/language/return_in_loop_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698