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

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

Issue 12759006: Use inferred type in the SSA builder for super calls, and fix a bug with operator== in the type inf… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: 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/types/simple_types_inferrer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (revision 20142)
+++ sdk/lib/_internal/compiler/implementation/types/simple_types_inferrer.dart (working copy)
@@ -108,6 +108,8 @@
throw 'Unsupported operation';
}
+ bool get isNullable => true;
+
String toString() => '$name sentinel type mask';
}
@@ -1048,6 +1050,17 @@
// also return null.
returnType = returnType.nullable();
}
+
+ if (analyzedElement.name == const SourceString('==')) {
+ // TODO(ngeoffray): Should this be done at the call site?
+ // When the argument passed in is null, we know we return a
+ // bool.
+ signature.forEachParameter((Element parameter) {
+ if (inferrer.typeOfElement(parameter).isNullable){
+ returnType = inferrer.computeLUB(returnType, inferrer.boolType);
+ }
+ });
+ }
}
if (analyzedElement == outermostElement) {

Powered by Google App Engine
This is Rietveld 408576698