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

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

Issue 17017003: Introduce an ElementTypeMask to recognize simple constraints like "the type of parameter foo is the… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/inferrer_visitor.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart (revision 24183)
+++ sdk/lib/_internal/compiler/implementation/types/inferrer_visitor.dart (working copy)
@@ -31,9 +31,9 @@
* Returns the least upper bound between [firstType] and
* [secondType].
*/
- TypeMask computeLUB(TypeMask firstType,
- TypeMask secondType,
- Compiler compiler) {
+TypeMask computeLUB(TypeMask firstType,
+ TypeMask secondType,
+ Compiler compiler) {
TypeMask dynamicType = compiler.typesTask.dynamicType;
if (firstType == null) {
return secondType;
@@ -41,6 +41,8 @@
return secondType;
} else if (firstType == dynamicType) {
return firstType;
+ } else if (firstType == secondType) {
+ return firstType;
} else {
TypeMask union = firstType.union(secondType, compiler);
// TODO(kasperl): If the union isn't nullable it seems wasteful

Powered by Google App Engine
This is Rietveld 408576698