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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/types.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: sdk/lib/_internal/compiler/implementation/types/types.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/types.dart (revision 23010)
+++ sdk/lib/_internal/compiler/implementation/types/types.dart (working copy)
@@ -19,6 +19,7 @@
part 'concrete_types_inferrer.dart';
part 'flat_type_mask.dart';
part 'type_mask.dart';
+part 'union_type_mask.dart';
/**
* Common super class for our type inferrers.
@@ -91,6 +92,9 @@
* is for debugging purposes only and can be omitted.
*/
TypeMask best(var type1, var type2, [element]) {
+ // TODO(polux): Handle [UnionTypeMask].
+ if (type1 != null) type1 = type1.simplify(compiler);
+ if (type2 != null) type2 = type2.simplify(compiler);
final result = _best(type1, type2);
// Tests type1 and type2 for equality modulo normalization of native types.
// Only called when DUMP_SURPRISING_RESULTS is true.

Powered by Google App Engine
This is Rietveld 408576698