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

Side by Side Diff: tests/compiler/dart2js/simple_inferrer_and_or_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, 5 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 import 'compiler_helper.dart'; 6 import 'compiler_helper.dart';
7 7
8 const String TEST = """ 8 const String TEST = """
9 class X {} 9 class X {}
10 returnDyn1() { 10 returnDyn1() {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 void main() { 57 void main() {
58 Uri uri = new Uri(scheme: 'source'); 58 Uri uri = new Uri(scheme: 'source');
59 var compiler = compilerFor(TEST, uri); 59 var compiler = compilerFor(TEST, uri);
60 compiler.runCompiler(uri); 60 compiler.runCompiler(uri);
61 var typesInferrer = compiler.typesTask.typesInferrer; 61 var typesInferrer = compiler.typesTask.typesInferrer;
62 62
63 checkReturn(String name, type) { 63 checkReturn(String name, type) {
64 var element = findElement(compiler, name); 64 var element = findElement(compiler, name);
65 Expect.equals(type, 65 Expect.equals(type,
66 typesInferrer.internal.returnTypeOf[element].simplify(compiler)); 66 typesInferrer.getReturnTypeOfElement(element).simplify(compiler));
67 } 67 }
68 68
69 var subclassOfInterceptor = 69 var subclassOfInterceptor =
70 findTypeMask(compiler, 'Interceptor', 'nonNullSubclass'); 70 findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
71 71
72 checkReturn('returnDyn1', subclassOfInterceptor); 72 checkReturn('returnDyn1', subclassOfInterceptor);
73 checkReturn('returnDyn2', subclassOfInterceptor); 73 checkReturn('returnDyn2', subclassOfInterceptor);
74 checkReturn('returnDyn3', subclassOfInterceptor); 74 checkReturn('returnDyn3', subclassOfInterceptor);
75 checkReturn('returnDyn4', typesInferrer.dynamicType.nonNullable()); 75 checkReturn('returnDyn4', typesInferrer.dynamicType.nonNullable());
76 checkReturn('returnDyn5', typesInferrer.dynamicType.nonNullable()); 76 checkReturn('returnDyn5', typesInferrer.dynamicType.nonNullable());
77 checkReturn('returnDyn6', typesInferrer.dynamicType.nonNullable()); 77 checkReturn('returnDyn6', typesInferrer.dynamicType.nonNullable());
78 } 78 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/list_tracer_test.dart ('k') | tests/compiler/dart2js/simple_inferrer_closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698