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

Unified Diff: sdk/lib/_internal/compiler/implementation/universe/universe.dart

Issue 12764005: Get rid of old code for union/intersection in HType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add comments. Created 7 years, 9 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/universe/universe.dart
diff --git a/sdk/lib/_internal/compiler/implementation/universe/universe.dart b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
index e2a679d107f5ba505d60fd3815799e9971161182..53902f44041535f5e01aeac14bfb9ad5465a2a05 100644
--- a/sdk/lib/_internal/compiler/implementation/universe/universe.dart
+++ b/sdk/lib/_internal/compiler/implementation/universe/universe.dart
@@ -459,7 +459,7 @@ class TypedSelector extends Selector {
selector.argumentCount,
selector.namedArguments) {
// Invariant: Typed selector can not be based on a malformed type.
- assert(!identical(mask.base.kind, TypeKind.MALFORMED_TYPE));
+ assert(mask.isEmpty || !identical(mask.base.kind, TypeKind.MALFORMED_TYPE));
assert(asUntyped.mask == null);
}
@@ -504,6 +504,12 @@ class TypedSelector extends Selector {
return appliesUntyped(element, compiler);
}
+ if (mask.isEmpty) {
+ if (!mask.isNullable) return false;
+ return hasElementIn(compiler.backend.jsNullClass, element)
+ && appliesUntyped(element, compiler);
+ }
+
// TODO(kasperl): Can't we just avoid creating typed selectors
// based of function types?
Element self = mask.base.element;
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/type_mask.dart ('k') | tests/compiler/dart2js/type_combination_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698