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

Unified Diff: sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart

Issue 15743003: Fix static warnings spotted by dartc. (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
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (revision 23012)
+++ sdk/lib/_internal/compiler/implementation/types/union_type_mask.dart (working copy)
@@ -30,8 +30,9 @@
} else if (mask.isEmpty && !mask.isNullable) {
continue;
} else {
- assert(mask.base == null || mask.base.element != compiler.dynamicClass);
- assert(mask is FlatTypeMask);
+ FlatTypeMask flatMask = mask;
+ assert(flatMask.base == null
+ || flatMask.base.element != compiler.dynamicClass);
int inListIndex = -1;
bool covered = false;
@@ -84,17 +85,18 @@
ClassElement secondElement = masks[1].base.element;
Iterable<ClassElement> candidates =
compiler.world.commonSupertypesOf(firstElement, secondElement);
+ bool unseenType = false;
for (int i = 2; i < masks.length; i++) {
ClassElement element = masks[i].base.element;
Set<ClassElement> supertypes = compiler.world.supertypesOf(element);
if (supertypes == null) {
- candidates.clear();
+ unseenType = true;
break;
}
candidates = candidates.where((e) => supertypes.contains(e));
}
- if (candidates.isEmpty) {
+ if (candidates.isEmpty || unseenType) {
// TODO(kasperl): Get rid of this check. It can only happen when
// at least one of the two base types is 'unseen'.
return new TypeMask(compiler.objectClass.rawType,
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698