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

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

Issue 2770063002: Revert "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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 duplicate initialization of a final field is a runtime error. 5 // Check that duplicate initialization of a final field is a runtime error.
6 6
7
7 class Class { 8 class Class {
8 final f = 10; 9 final f = 10;
9 10
10 Class(v) : f = v; // //# 01: runtime error, static type warning 11 Class(v) : f = v; // //# 01: runtime error, static type warning
11 12
12 Class(this.f); // //# 02: runtime error, static type warning 13 Class(this.f); // //# 02: runtime error, static type warning
13 14
14 // If a field is initialized multiple times in the initializer 15 // If a field is initialized multiple times in the initializer
15 // list, it's a compile time error. 16 // list, it's a compile time error.
16 Class(this.f) : f = 0; // //# 03: compile-time error 17 Class(this.f) : f = 0; // //# 03: compile-time error
17 } 18 }
18 19
19 main() { 20 main() {
20 new Class(5); // //# 01: continued 21 new Class(5); // //# 01: continued
21 new Class(5); // //# 02: continued 22 new Class(5); // //# 02: continued
22 new Class(5); // //# 03: continued 23 new Class(5); // //# 03: continued
23 } 24 }
OLDNEW
« no previous file with comments | « tests/language/constructor_call_as_function_test.dart ('k') | tests/language/constructor_duplicate_initializers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698