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

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

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Regression test for dart2js's inferrer that used to not propagate 5 // Regression test for dart2js's inferrer that used to not propagate
6 // types given to generative constructors in super constructor calls. 6 // types given to generative constructors in super constructor calls.
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 class A { 10 class A {
11 final field; 11 final field;
12 A.full(this.field); 12 A.full(this.field);
13 } 13 }
14 14
15 class B extends A { 15 class B extends A {
16 // The following super call used to not be analyzed properly. 16 // The following super call used to not be analyzed properly.
17 B.full(field) : super.full(field); 17 B.full(field) : super.full(field);
18 } 18 }
19 19
20 main() { 20 main() {
21 // Call [A.full] with an int to have the inferrer think [field] is 21 // Call [A.full] with an int to have the inferrer think [field] is
22 // always an int. 22 // always an int.
23 Expect.equals(84, new A.full(42).field + 42); 23 Expect.equals(84, new A.full(42).field + 42);
24 Expect.throws(() => new B.full(null).field + 42, 24 Expect.throws(
25 (e) => e is NoSuchMethodError); 25 () => new B.full(null).field + 42, (e) => e is NoSuchMethodError);
26 } 26 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698