anchor.diff:            mappedType = new TypeMask.nonNullExact(
                 inferrer.rawTypeOf(type.element));
           }
  -        if (returnType == null) {
  -          returnType = mappedType;
  -        } else {
  -          // TODO(ngeoffray): Do the union.
  -          return inferrer.dynamicType;
  -        }
  +        returnType = inferrer.computeLUB(returnType, mappedType);
         }
         return returnType;
       } else if (name == const SourceString('JS_OPERATOR_IS_PREFIX')
  
positive.code:           mappedType = inferrer.numType;
          } else if (type.element == compiler.boolClass) {
            mappedType = inferrer.boolType;
          } else if (compiler.world.hasAnySubclass(type.element)) {
            mappedType = new TypeMask.nonNullSubclass(
                inferrer.rawTypeOf(type.element));
  
negative.code: 
    /**
     * Returns the least upper bound between [firstType] and
     * [secondType].
     */
    TypeMask computeLUB(TypeMask firstType, TypeMask secondType) {
      assert(secondType != null);
      if (firstType == null) {
        return secondType;
      } else if (isGiveUpType(firstType)) {
        return firstType;
      } else if (isGiveUpType(secondType)) {
        return secondType;
      } else if (isDynamicType(secondType)) {
        return secondType;
      } else if (isDynamicType(firstType)) {
        return firstType;
      } else if (firstType == nullType) {
        return secondType.nullable();
      } else if (secondType == nullType) {
        return firstType.nullable();
      } else {
        TypeMask union = firstType.union(secondType, compiler);
        return union == null ? giveUpType : union;
      }
    }
  }
  