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

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

Issue 17635006: Add a TypeInformation abstraction in the inferrer, that holds information per element, to get rid o… (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
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 Uri uri = new Uri(scheme: 'source'); 96 Uri uri = new Uri(scheme: 'source');
97 97
98 var compiler = compilerFor(TEST1, uri); 98 var compiler = compilerFor(TEST1, uri);
99 compiler.runCompiler(uri); 99 compiler.runCompiler(uri);
100 var typesInferrer = compiler.typesTask.typesInferrer; 100 var typesInferrer = compiler.typesTask.typesInferrer;
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.getReturnTypeOfElement(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.nonNullable()); 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.nonNullable()); 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 checkReturn('test6', typesInferrer.numType); 127 checkReturn('test6', typesInferrer.numType);
128 checkReturn('test7', typesInferrer.intType); 128 checkReturn('test7', typesInferrer.intType);
129 checkReturn('test8', typesInferrer.intType); 129 checkReturn('test8', typesInferrer.intType);
130 checkReturn('test9', typesInferrer.intType); 130 checkReturn('test9', typesInferrer.intType);
131 checkReturn('test10', typesInferrer.numType); 131 checkReturn('test10', typesInferrer.numType);
132 checkReturn('test11', typesInferrer.doubleType); 132 checkReturn('test11', typesInferrer.doubleType);
133 } 133 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698