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

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

Issue 14997006: Introduce a UnionTypeMask, currently limited to 4 types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js/simple_inferrer_test.dart
===================================================================
--- tests/compiler/dart2js/simple_inferrer_test.dart (revision 23010)
+++ tests/compiler/dart2js/simple_inferrer_test.dart (working copy)
@@ -443,7 +443,10 @@
checkReturn(String name, type) {
var element = findElement(compiler, name);
- Expect.equals(type, typesInferrer.internal.returnTypeOf[element], name);
+ Expect.equals(
+ type,
+ typesInferrer.internal.returnTypeOf[element].simplify(compiler),
+ name);
}
var interceptorType =
findTypeMask(compiler, 'Interceptor', 'nonNullSubclass');
@@ -491,8 +494,8 @@
checkReturn('returnTopLevelGetter', typesInferrer.intType);
checkReturn('testDeadCode', typesInferrer.intType);
checkReturn('testLabeledIf', typesInferrer.intType.nullable());
- checkReturn('testSwitch1',
- typesInferrer.intType.union(typesInferrer.doubleType, compiler).nullable());
+ checkReturn('testSwitch1', typesInferrer.intType
+ .union(typesInferrer.doubleType, compiler).nullable().simplify(compiler));
checkReturn('testSwitch2', typesInferrer.intType);
checkReturn('testSwitch3', interceptorType.nullable());
checkReturn('testContinue1', interceptorType.nullable());
@@ -503,7 +506,8 @@
checkReturnInClass(String className, String methodName, type) {
var cls = findElement(compiler, className);
var element = cls.lookupLocalMember(buildSourceString(methodName));
- Expect.equals(type, typesInferrer.internal.returnTypeOf[element]);
+ Expect.equals(type,
+ typesInferrer.internal.returnTypeOf[element].simplify(compiler));
}
checkReturnInClass('A', 'returnInt1', typesInferrer.intType);

Powered by Google App Engine
This is Rietveld 408576698