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

Side by Side Diff: tests/compiler/dart2js/simple_inferrer_no_such_method_test.dart

Issue 17290005: Update inferrer test after r24138. (Closed) Base URL: https://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 | « no previous file | 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
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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 6
7 import 'compiler_helper.dart'; 7 import 'compiler_helper.dart';
8 import 'parser_helper.dart'; 8 import 'parser_helper.dart';
9 9
10 const String TEST1 = """ 10 const String TEST1 = """
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 checkReturn(String name, type) { 102 checkReturn(String name, type) {
103 var element = findElement(compiler, name); 103 var element = findElement(compiler, name);
104 Expect.equals( 104 Expect.equals(
105 type, 105 type,
106 typesInferrer.internal.returnTypeOf[element].simplify(compiler), 106 typesInferrer.internal.returnTypeOf[element].simplify(compiler),
107 name); 107 name);
108 } 108 }
109 109
110 checkReturn('test1', typesInferrer.intType); 110 checkReturn('test1', typesInferrer.intType);
111 checkReturn('test2', typesInferrer.dynamicType); 111 checkReturn('test2', typesInferrer.dynamicType.nonNullable());
112 checkReturn('test3', typesInferrer.intType); 112 checkReturn('test3', typesInferrer.intType);
113 checkReturn('test4', typesInferrer.mapType); 113 checkReturn('test4', typesInferrer.mapType);
114 checkReturn('test5', typesInferrer.dynamicType.nonNullable()); 114 checkReturn('test5', typesInferrer.dynamicType.nonNullable());
115 checkReturn('test6', typesInferrer.dynamicType.nonNullable()); 115 checkReturn('test6', typesInferrer.dynamicType.nonNullable());
116 116
117 compiler = compilerFor(TEST2, uri); 117 compiler = compilerFor(TEST2, uri);
118 compiler.runCompiler(uri); 118 compiler.runCompiler(uri);
119 typesInferrer = compiler.typesTask.typesInferrer; 119 typesInferrer = compiler.typesTask.typesInferrer;
120 120
121 checkReturn('test1', typesInferrer.dynamicType); 121 checkReturn('test1', typesInferrer.dynamicType.nonNullable());
122 checkReturn('test2', typesInferrer.mapType); 122 checkReturn('test2', typesInferrer.mapType);
123 checkReturn('test3', typesInferrer.mapType); 123 checkReturn('test3', typesInferrer.mapType);
124 checkReturn('test4', typesInferrer.mapType); 124 checkReturn('test4', typesInferrer.mapType);
125 checkReturn('test5', typesInferrer.mapType); 125 checkReturn('test5', typesInferrer.mapType);
126 126
127 // TODO(ngeoffray): The reason for nullablity is because the 127 checkReturn('test6', typesInferrer.numType);
128 // inferrer thinks Object.noSuchMethod return null. Once we track
129 // aborting control flow in the analysis, we won't get the nullable
130 // anymore.
131 checkReturn('test6', typesInferrer.numType.nullable());
132 checkReturn('test7', typesInferrer.intType); 128 checkReturn('test7', typesInferrer.intType);
133 checkReturn('test8', typesInferrer.intType); 129 checkReturn('test8', typesInferrer.intType);
134 checkReturn('test9', typesInferrer.intType); 130 checkReturn('test9', typesInferrer.intType);
135 checkReturn('test10', typesInferrer.numType); 131 checkReturn('test10', typesInferrer.numType);
136 checkReturn('test11', typesInferrer.doubleType); 132 checkReturn('test11', typesInferrer.doubleType);
137 } 133 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698