Returns whether this type should be automatically casted to
the target type in an arithmetic operation.
172093
@PublicEvolving
	public boolean shouldAutocastTo(BasicTypeInfo<?> to) {
		for (Class<?> possibleTo: possibleCastTargetTypes) {
			if (possibleTo.equals(to.getTypeClass())) {
				return true;
			}
		}
		return false;
	}
761417
private SemanticType checkIntegerOperator(Expr.BinaryOperator expr, Environment environment) {
		checkOperand(Type.Int, expr.getFirstOperand(), environment);
		checkOperand(Type.Int, expr.getSecondOperand(), environment);
		return Type.Int;
	}
892737
private static boolean hasTypeVariables(final Type type) {
        if (type instanceof TypeVariable<?> || type instanceof GenericArrayType) {
            return true;
        } else if (type instanceof ParameterizedType) {
            for (final Type arg : ((ParameterizedType) type).getActualTypeArguments()) {
                if (hasTypeVariables(arg)) {
                    return true;
                }
            }
        }
        return false;
    }
385617
private boolean areTypesAssignable(Class<?> source, Class<?> target)
   {
      if (target.isAssignableFrom(source))
      {
         return true;
      }
      else if (!source.isPrimitive() && !target.isPrimitive())
      {
         return false;
      }
      else if (source.isPrimitive())
      {
         // source is primitive
         return primitiveToWrapperMap.get(source) == target;
      }
      else
      {
         // target is primitive
         return source == primitiveToWrapperMap.get(target);
      }
   }
784155
def special_target_typecheck(value):
    
    result = True
    # if key:Optional exists, it must be a dict object
    result &= isinstance(value.get(TARGET_OPTIONAL_FIELD, dict()), dict)
    return result
965542
public static boolean isDoubleType(Class<?> type) {
        return (type.isPrimitive() && type == float.class) || (type.isPrimitive() && type == double.class)
                || (!type.isPrimitive() && type == Float.class) || (!type.isPrimitive() && type == Double.class);
    }
93069
void refineOperandType(VoltType valueType) {
        if (m_valueType != VoltType.NUMERIC) {
            return;
        }

        if (valueType == VoltType.DECIMAL) {
            m_valueType = VoltType.DECIMAL;
            m_valueSize = VoltType.DECIMAL.getLengthInBytesForFixedTypes();
        }
        else {
            m_valueType = VoltType.FLOAT;
            m_valueSize = VoltType.FLOAT.getLengthInBytesForFixedTypes();
        }
    }
1301843
private boolean verifyTypes()
    {
        SuccessAndResult<ThriftType> output = topologicalSort(thriftTypes, new Predicate<ThriftType>()
        {
            @Override
            public boolean apply(@Nullable ThriftType t)
            {
                ThriftProtocolType proto = checkNotNull(t).getProtocolType();
                if (proto == ThriftProtocolType.ENUM || proto == ThriftProtocolType.STRUCT) {
                    return verifyStruct(t, true);
                } else {
                    Preconditions.checkState(false, "Top-level non-enum and non-struct?");
                    return false;   // silence compiler
                }
            }
        });
        if (output.success) {
            thriftTypes = output.result;
            return true;
        } else {
            for (ThriftType t: output.result) {
                // we know it's gonna fail, we just want the precise error message
                verifyStruct(t, false);
            }
            return false;
        }
    }
121932
public boolean isCastOperatorLinkingEnabled(SarlCastedExpression cast) {
		final LightweightTypeReference sourceType = getStackedResolvedTypes().getReturnType(cast.getTarget());
		final LightweightTypeReference destinationType = getReferenceOwner().toLightweightTypeReference(cast.getType());
		if (sourceType.isPrimitiveVoid() || destinationType.isPrimitiveVoid()) {
			return false;
		}
		if (sourceType.isPrimitive() && destinationType.isPrimitive()) {
			return false;
		}
		return !sourceType.isSubtypeOf(destinationType.getType());
	}
84591
def auto_type(s):
    
    if isinstance(s, bool):
        return s
    elif s is None:
        return ''
    elif s == 'TRUE':
        return True
    elif s == 'FALSE':
        return False
    else:
        try:
            try:
                # telephone numbers may be wrongly interpretted as ints
                if s.startswith('+'):
                    return s
                else:
                    return int(s)
            except ValueError:
                return float(s)

        except ValueError:
            return s
1120930
public void setCalculationType(CalculationType type) {
        cType = type;

        // ensure civil property is up-to-date
        if(cType == CalculationType.ISLAMIC_CIVIL)
            civil = true;
        else
            civil = false;
    }
769847
public static boolean isNumericPrimitive(SoyType type) {
    SoyType.Kind kind = type.getKind();
    if (NUMERIC_PRIMITIVES.contains(kind)) {
      return true;
    }
    return type.isAssignableFrom(NUMBER_TYPE) || NUMBER_TYPE.isAssignableFrom(type);
  }
728323
private int typeDepth(Class<?> match, Class<?> actual)
  {
    if (actual == null) {
      return Integer.MAX_VALUE / 2;
    }
    
    if (match.equals(Object.class)) {
      return Integer.MAX_VALUE / 4;
    }
    
    if (match.equals(actual)) {
      return 0;
    }
    
    int cost = 1 + typeDepth(match, actual.getSuperclass());
    
    for (Class<?> iface : actual.getInterfaces()) {
      cost = Math.min(cost, 1 + typeDepth(match, iface));
    }
    
    return cost;
  }
945400
public void castToNonPrimitiveIfNecessary(final ClassNode sourceType, final ClassNode targetType) {
        OperandStack os = controller.getOperandStack();
        ClassNode boxedType = os.box();
        if (WideningCategories.implementsInterfaceOrSubclassOf(boxedType, targetType)) return;
        MethodVisitor mv = controller.getMethodVisitor();
        if (ClassHelper.CLASS_Type.equals(targetType)) {
            castToClassMethod.call(mv);
        } else if (ClassHelper.STRING_TYPE.equals(targetType)) {
            castToStringMethod.call(mv);
        } else if (targetType.isDerivedFrom(ClassHelper.Enum_Type)) {
            (new ClassExpression(targetType)).visit(controller.getAcg());
            os.remove(1);
            castToEnumMethod.call(mv);
            BytecodeHelper.doCast(mv, targetType);
        } else {
            (new ClassExpression(targetType)).visit(controller.getAcg());
            os.remove(1);
            castToTypeMethod.call(mv);
        }
    }
1039067
private static boolean isNumericType(Class<?> c) {
    return Number.class.isAssignableFrom(c)
        || double.class == c
        || float.class == c
        || long.class == c
        || int.class == c
        || short.class == c
        || byte.class == c;
  }
1131463
function checkTypeSelector(i) {
  if (i >= tokensLength) return 0;

  const start = i;
  let l;

  if (l = checkNamePrefix(i)) i += l;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  return i - start;
}
560410
final public Boolean checkPositionType(String type) {
    if (tokenPosition == null) {
      return false;
    } else {
      return tokenPosition.checkType(type);
    }
  }