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:   }
  
    bool internalRecordType(Element analyzedElement,
                            TypeMask type,
                            Map<Element, TypeMask> types) {
      assert(type != null);
      TypeMask existing = types[analyzedElement];
      TypeMask newType = isDynamicType(existing)
          ? type // Previous analysis did not find any type.
          : computeLUB(existing, type);
      types[analyzedElement] = newType;
      // If the return type is useful, say it has changed.
      return existing != newType
  
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;
      }
    }
  }
  