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

Side by Side Diff: tests/language_strong/inferrer_constructor3_test.dart

Issue 2806543002: Issue 29186. Make several top-level variables explicitly 'dynamic'. (Closed)
Patch Set: 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 that used to optimistically infer the 5 // Regression test for dart2js that used to optimistically infer the
6 // wrong types for fields because of generative constructors being 6 // wrong types for fields because of generative constructors being
7 // inlined. 7 // inlined.
8 8
9 import "package:expect/expect.dart"; 9 import "package:expect/expect.dart";
10 import "compiler_annotations.dart"; 10 import "compiler_annotations.dart";
11 11
12 class A { 12 class A {
13 var field; 13 var field;
14 A(this.field); 14 A(this.field);
15 } 15 }
16 16
17 var c = () => new List(42)[0]; 17 dynamic c = () => new List(42)[0];
18 18
19 main() { 19 main() {
20 bar(); 20 bar();
21 // Defeat type inferencing. 21 // Defeat type inferencing.
22 new A(c()); 22 new A(c());
23 doIt(); 23 doIt();
24 bar(); 24 bar();
25 } 25 }
26 26
27 @DontInline() 27 @DontInline()
(...skipping 17 matching lines...) Expand all
45 return inlineLevel3(); 45 return inlineLevel3();
46 } 46 }
47 47
48 inlineLevel3() { 48 inlineLevel3() {
49 return inlineLevel4(); 49 return inlineLevel4();
50 } 50 }
51 51
52 inlineLevel4() { 52 inlineLevel4() {
53 return new A(42); 53 return new A(42);
54 } 54 }
OLDNEW
« no previous file with comments | « tests/corelib_strong/error_stack_trace2_test.dart ('k') | tests/language_strong/language_strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698