system/src/sc/lang/java/ModelUtil.java
public static Object blendTypes(Object lhsType, Object rhsType) {
      // If you have one side that is ? super SuperType and we have SubType extends SuperType, oddly this seems to clamp the
      // coerced type to SuperType
      if (lhsType instanceof ExtendsType.LowerBoundsTypeDeclaration) {
         ExtendsType.LowerBoundsTypeDeclaration lbt = (ExtendsType.LowerBoundsTypeDeclaration) lhsType;
         if (lbt.baseType == Object.class)
            return rhsType;
         if (ModelUtil.isAssignableFrom(rhsType, lbt.baseType))
            return lbt.baseType;
         return rhsType;
      }
      if (rhsType instanceof ExtendsType.LowerBoundsTypeDeclaration) {
         ExtendsType.LowerBoundsTypeDeclaration rbt = (ExtendsType.LowerBoundsTypeDeclaration) rhsType;
         if (rbt.baseType == Object.class)
            return lhsType;
         if (ModelUtil.isAssignableFrom(rbt.baseType, lhsType))
            return rbt.baseType;
         return lhsType;
      }

      return lhsType;
   }
/**
    * This is used to combine the inferredType with the type extracted from the parameters in determining "the" type.
    * Originally it also called coerceTypes but ran into some problems with that.
    */
This is used to combine the inferredType with the type extracted from the parameters in determining "the" type.
Originally it also called coerceTypes but ran into some problems with that.
This is used to combine the inferredType with the type extracted from the parameters in determining " the " type . Originally it also called coerceTypes but ran into some problems with that .
public static Object blendTypes(Object lhsType, Object rhsType) {
      if (lhsType instanceof ExtendsType.LowerBoundsTypeDeclaration) {
         ExtendsType.LowerBoundsTypeDeclaration lbt = (ExtendsType.LowerBoundsTypeDeclaration) lhsType;
         if (lbt.baseType == Object.class)
            return rhsType;
         if (ModelUtil.isAssignableFrom(rhsType, lbt.baseType))
            return lbt.baseType;
         return rhsType;
      }
      if (rhsType instanceof ExtendsType.LowerBoundsTypeDeclaration) {
         ExtendsType.LowerBoundsTypeDeclaration rbt = (ExtendsType.LowerBoundsTypeDeclaration) rhsType;
         if (rbt.baseType == Object.class)
            return lhsType;
         if (ModelUtil.isAssignableFrom(rbt.baseType, lhsType))
            return rbt.baseType;
         return lhsType;
      }
      return lhsType;
   }
public static Object blendTypes ( Object lhsType , Object rhsType ) { if ( lhsType instanceof ExtendsType . LowerBoundsTypeDeclaration ) { ExtendsType . LowerBoundsTypeDeclaration lbt = ( ExtendsType . LowerBoundsTypeDeclaration ) lhsType ; if ( lbt . baseType == Object . class ) return rhsType ; if ( ModelUtil . isAssignableFrom ( rhsType , lbt . baseType ) ) return lbt . baseType ; return rhsType ; } if ( rhsType instanceof ExtendsType . LowerBoundsTypeDeclaration ) { ExtendsType . LowerBoundsTypeDeclaration rbt = ( ExtendsType . LowerBoundsTypeDeclaration ) rhsType ; if ( rbt . baseType == Object . class ) return lhsType ; if ( ModelUtil . isAssignableFrom ( rbt . baseType , lhsType ) ) return rbt . baseType ; return lhsType ; } return lhsType ; }
This is used to combine the inferredType with the type extracted from the parameters in determining "the" type.
This is used to combine the inferredType with the type extracted from the parameters in determining " the " type .
// If you have one side that is ? super SuperType and we have SubType extends SuperType, oddly this seems to clamp the // coerced type to SuperType