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

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

Issue 16077015: Rip-off the backend type inferrer. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « tests/compiler/dart2js/return_type_inferer_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) 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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Regression test for dart2js that used to optimistically infer the
6 // wrong types for fields because of generative constructors being
7 // inlined.
8
9 import "package:expect/expect.dart";
10 import "compiler_annotations.dart";
11
12 class A {
13 var field;
14 A(this.field);
15 }
16
17 var c = () => new List(42)[0];
18
19 main() {
20 bar();
21 // Defeat type inferencing.
22 new A(c());
23 doIt();
24 bar();
25 }
26
27 @DontInline
28 doIt() {
29 () => 42;
30 var c = new A(null);
31 Expect.throws(() => c.field + 42, (e) => e is NoSuchMethodError);
32 }
33
34 @DontInline
35 bar() {
36 () => 42;
37 return inlineLevel1();
38 }
39
40 inlineLevel1() {
41 return inlineLevel2();
42 }
43
44 inlineLevel2() {
45 return inlineLevel3();
46 }
47
48 inlineLevel3() {
49 return inlineLevel4();
50 }
51
52 inlineLevel4() {
53 return new A(42);
54 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/return_type_inferer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698