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

Unified Diff: tests/compiler/dart2js/concrete_type_inference_test.dart

Issue 2468303003: dart2js: move type-mask intermediate data from tree-elements into the global (Closed)
Patch Set: bug fix: handle closures and constructor bodies Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/types/types.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/concrete_type_inference_test.dart
diff --git a/tests/compiler/dart2js/concrete_type_inference_test.dart b/tests/compiler/dart2js/concrete_type_inference_test.dart
index e3833ad61c39827fcd16fc5898222a45b2f30ee7..29317ae159e08c956c225c3e3e0d3f6734b6781b 100644
--- a/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ b/tests/compiler/dart2js/concrete_type_inference_test.dart
@@ -20,24 +20,21 @@ void checkPrintType(String expression, checkType(compiler, type)) {
asyncTest(() => compileAndFind('main() { print($expression); }', 'print',
(compiler, printElement) {
var parameter = printElement.functionSignature.requiredParameters.first;
- var type = compiler.globalInference.results.typeOf(parameter);
- checkType(compiler, type);
+ checkType(compiler, _typeOf(compiler, parameter));
}));
asyncTest(() =>
compileAndFind('main() { var x = print; print($expression); }', 'print',
(compiler, printElement) {
var parameter = printElement.functionSignature.requiredParameters.first;
- var type = compiler.globalInference.results.typeOf(parameter);
- checkType(compiler, type);
+ checkType(compiler, _typeOf(compiler, parameter));
}));
asyncTest(() => compileAndFind(
'main() { print($expression); print($expression); }', 'print',
(compiler, printElement) {
var parameter = printElement.functionSignature.requiredParameters.first;
- var type = compiler.globalInference.results.typeOf(parameter);
- checkType(compiler, type);
+ checkType(compiler, _typeOf(compiler, parameter));
}));
}
@@ -72,13 +69,9 @@ void testOptionalParameters() {
var secondParameter = fiskElement.functionSignature.optionalParameters[0];
var thirdParameter = fiskElement.functionSignature.optionalParameters[1];
var commonMasks = compiler.commonMasks;
- var inference = compiler.globalInference;
- Expect.identical(
- commonMasks.uint31Type, inference.results.typeOf(firstParameter));
- Expect.identical(
- commonMasks.nullType, inference.results.typeOf(secondParameter));
- Expect.identical(
- commonMasks.nullType, inference.results.typeOf(thirdParameter));
+ Expect.identical(commonMasks.uint31Type, _typeOf(compiler, firstParameter));
+ Expect.identical(commonMasks.nullType, _typeOf(compiler, secondParameter));
+ Expect.identical(commonMasks.nullType, _typeOf(compiler, thirdParameter));
});
}
@@ -86,3 +79,6 @@ void main() {
testBasicTypes();
testOptionalParameters();
}
+
+_typeOf(compiler, parameter) =>
+ compiler.globalInference.results.resultOf(parameter).type;
« no previous file with comments | « pkg/compiler/lib/src/types/types.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698