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

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

Issue 2774783002: Re-land "Format all multitests" (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Check that passing `null` for a boolean typed parameter will still cause 5 // Check that passing `null` for a boolean typed parameter will still cause
6 // a boolean conversion error when used in a condition in checked mode. 6 // a boolean conversion error when used in a condition in checked mode.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 @NoInline() 10 @NoInline()
11 String check({bool a, bool b}) { 11 String check({bool a, bool b}) {
12 String a_string = a ? 'a' : ''; 12 String a_string = a ? 'a' : '';
13 String b_string = b ? 'b' : ''; 13 String b_string = b ? 'b' : '';
14 return '$a_string$b_string'; 14 return '$a_string$b_string';
15 } 15 }
16 16
17 class Class { 17 class Class {
18 final String field; 18 final String field;
19 Class({bool a: false, bool b: true}) : this.field = check(a: a, b: b); 19 Class({bool a: false, bool b: true}) : this.field = check(a: a, b: b);
20 } 20 }
21 21
22 main() { 22 main() {
23 Expect.equals('', new Class(a: null, b: null).field); //# 01: dynamic type err or 23 Expect.equals('', new Class(a: null, b: null).field); //# 01: dynamic type err or
24 } 24 }
OLDNEW
« no previous file with comments | « tests/language/black_listed_test.dart ('k') | tests/language/built_in_identifier_illegal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698