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

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

Issue 2999723002: Add stub versions of KernelInferrerEngine and friends (Closed)
Patch Set: Updated cf. comments Created 3 years, 4 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'compiler_helper.dart'; 7 import 'compiler_helper.dart';
8 import 'type_mask_test_helper.dart'; 8 import 'type_mask_test_helper.dart';
9 9
10 const String TEST = """ 10 const String TEST = """
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 """; 115 """;
116 116
117 void main() { 117 void main() {
118 Uri uri = new Uri(scheme: 'source'); 118 Uri uri = new Uri(scheme: 'source');
119 var compiler = compilerFor(TEST, uri); 119 var compiler = compilerFor(TEST, uri);
120 asyncTest(() => compiler.run(uri).then((_) { 120 asyncTest(() => compiler.run(uri).then((_) {
121 var typesInferrer = compiler.globalInference.typesInferrerInternal; 121 var typesInferrer = compiler.globalInference.typesInferrerInternal;
122 var closedWorld = typesInferrer.closedWorld; 122 var closedWorld = typesInferrer.closedWorld;
123 123
124 checkReturn(String name, type) { 124 checkReturn(String name, type) {
125 var element = findElement(compiler, name); 125 MemberElement element = findElement(compiler, name);
126 Expect.equals( 126 Expect.equals(
127 type, 127 type,
128 simplify( 128 simplify(
129 typesInferrer.getReturnTypeOfMember(element), closedWorld), 129 typesInferrer.getReturnTypeOfMember(element), closedWorld),
130 name); 130 name);
131 } 131 }
132 132
133 checkReturn('returnInt1', closedWorld.commonMasks.uint31Type); 133 checkReturn('returnInt1', closedWorld.commonMasks.uint31Type);
134 checkReturn('returnInt2', closedWorld.commonMasks.uint31Type); 134 checkReturn('returnInt2', closedWorld.commonMasks.uint31Type);
135 checkReturn('returnInt3', closedWorld.commonMasks.uint31Type); 135 checkReturn('returnInt3', closedWorld.commonMasks.uint31Type);
(...skipping 16 matching lines...) Expand all
152 type, 152 type,
153 simplify( 153 simplify(
154 typesInferrer.getReturnTypeOfMember(element), closedWorld)); 154 typesInferrer.getReturnTypeOfMember(element), closedWorld));
155 } 155 }
156 156
157 dynamic cls = findElement(compiler, 'A'); 157 dynamic cls = findElement(compiler, 'A');
158 checkReturnInClass( 158 checkReturnInClass(
159 'A', 'foo', new TypeMask.nonNullExact(cls, closedWorld)); 159 'A', 'foo', new TypeMask.nonNullExact(cls, closedWorld));
160 })); 160 }));
161 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698