check for many diff types

@param pc
@param type
@param value
@return
@throws ExpressionException
173431
public static boolean call(PageContext pc, String type, Object value) throws ExpressionException {
	type = type.trim();

	if ("range".equalsIgnoreCase(type)) throw new FunctionException(pc, "isValid", 1, "type", "for [range] you have to define a min and max value");

	if ("regex".equalsIgnoreCase(type) || "regular_expression".equalsIgnoreCase(type))
	    throw new FunctionException(pc, "isValid", 1, "type", "for [regex] you have to define a pattern");

	return Decision.isValid(type, value);
    }
619474
function (typeSpecs, values, location) {
	    checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
	  }
1235774
private ClassNode checkForTargetType(final Expression expr, final ClassNode type) {
        BinaryExpression enclosingBinaryExpression = typeCheckingContext.getEnclosingBinaryExpression();
        if (enclosingBinaryExpression instanceof DeclarationExpression
                && isEmptyCollection(expr) && isAssignment(enclosingBinaryExpression.getOperation().getType())) {
            VariableExpression target = (VariableExpression) enclosingBinaryExpression.getLeftExpression();
            return adjustForTargetType(target.getType(), type);
        }
        if (currentField != null) {
            return adjustForTargetType(currentField.getType(), type);
        }
        if (currentProperty != null) {
            return adjustForTargetType(currentProperty.getType(), type);
        }
        MethodNode enclosingMethod = typeCheckingContext.getEnclosingMethod();
        if (enclosingMethod != null) {
            return adjustForTargetType(enclosingMethod.getReturnType(), type);
        }
        return type;
    }
890890
public DiscriminatorJdbcSubBuilder when(String value, Class<? extends T> type) {
        return when(value, (Type)type);
    }
587361
public static Type inferType(Expression2 expression, Type rootType, TypeDeclaration typeDeclaration) {
    Map<Integer, Type> subexpressionTypeMap = inferTypeMap(expression, rootType, typeDeclaration);
    return subexpressionTypeMap.get(0);
  }
831262
function checkType(value, type) {
  if (typeof type === 'string') {
    switch (type) {
      case 'string':
      case 'object':
      case 'number':
      case 'boolean':
      case 'function':
        return typeof value === type;
      case 'class':
        return typeof value === 'function';
      case 'array':
        return value.constructor === Array;
      default:
        return false;
    }
  }
  else {
    return value instanceof type;
  }
}
164527
private void evaluateExpressions() throws JspException {
        /* 
         * Note: we don't check for type mismatches here; we assume
         * the expression evaluator will return the expected type
         * (by virtue of knowledge we give it about what that type is).
         * A ClassCastException here is truly unexpected, so we let it
         * propagate up.
         */

        // 'value' attribute
        if (value_ != null) {
            value = (String) ExpressionEvaluatorManager.evaluate(
                    "value", value_, String.class, this, pageContext);
        }

        // 'type' attribute
        if (type_ != null) {
            type = (String) ExpressionEvaluatorManager.evaluate(
                    "type", type_, String.class, this, pageContext);
        }

        // 'dateStyle' attribute
        if (dateStyle_ != null) {
            dateStyle = (String) ExpressionEvaluatorManager.evaluate(
                    "dateStyle", dateStyle_, String.class, this, pageContext);
        }

        // 'timeStyle' attribute
        if (timeStyle_ != null) {
            timeStyle = (String) ExpressionEvaluatorManager.evaluate(
                    "timeStyle", timeStyle_, String.class, this, pageContext);
        }

        // 'pattern' attribute
        if (pattern_ != null) {
            pattern = (String) ExpressionEvaluatorManager.evaluate(
                    "pattern", pattern_, String.class, this, pageContext);
        }

        // 'timeZone' attribute
        if (timeZone_ != null) {
            timeZone = ExpressionEvaluatorManager.evaluate(
                    "timeZone", timeZone_, Object.class, this, pageContext);
        }

        // 'parseLocale' attribute
        if (parseLocale_ != null) {
            Object obj = ExpressionEvaluatorManager.evaluate(
                    "parseLocale", parseLocale_, Object.class, this, pageContext);
            Locale locale = LocaleUtil.parseLocaleAttributeValue(obj);
            if (locale != null) {
                this.parseLocale = locale;
            }
        }
    }
351996
private static final void checkComparators(int[] pos1, int[] pos2, 
							Class<? extends Key<?>>[] types1, Class<? extends Key<?>>[] types2)
	{
		if (pos1.length != pos2.length || types1.length != types2.length) {
			throw new IllegalArgumentException(
				"The given pair of RecordComparators does not operate on the same number of fields.");
		}
		for (int i = 0; i < types1.length; i++) {
			if (!types1[i].equals(types2[i])) {
				throw new IllegalArgumentException(
				"The given pair of RecordComparators does not operates on different data types.");
			}
		}
	}
850369
public function elseValue($value = null, $type = null)
    {
        if (is_array($value)) {
            end($value);
            $value = key($value);
        }

        if ($value !== null && !$value instanceof ExpressionInterface) {
            $value = $this->_castToExpression($value, $type);
        }

        if (!$value instanceof ExpressionInterface) {
            $value = ['value' => $value, 'type' => $type];
        }

        $this->_elseValue = $value;
    }
278938
public boolean recordType(JSTypeExpression type) {
    if (type != null && !hasAnyTypeRelatedTags()) {
      currentInfo.setType(type);
      populated = true;
      return true;
    } else {
      return false;
    }
  }
474619
function (typeSpecs, values, location) {
    if (process.env.NODE_ENV !== 'production') {
      checkReactTypeSpec(typeSpecs, values, location, this.getName(), null, this._debugID);
    }
  }
1128773
public static final double diff(String expression, double val) throws InvalidExpressionException {

        ExpressionTree expTree = parseToTree(expression);

        expTree.derive();
        expTree.reduce();

        return expTree.getVal();
    }
727659
public static <T,V extends Object> void type(V value, Class<T> type) {
		if(!validation) return;
		notNull(value);
		notNull(type);
		if(!type.isAssignableFrom(value.getClass())){
			throw new TypeException(type.getCanonicalName());
		}
	}
11960
private void checkStrictParamType(
      final TemplateNode node, final TemplateParam param, @Nullable SoyValueProvider paramValue) {
    Kind kind = param.type().getKind();
    if (kind == Kind.ANY || kind == Kind.UNKNOWN) {
      // Nothing to check.  ANY and UKNOWN match all types.
      return;
    }
    if (paramValue == null) {
      paramValue = NullData.INSTANCE;
    } else if (paramValue instanceof SoyAbstractCachingValueProvider) {
      SoyAbstractCachingValueProvider typedValue = (SoyAbstractCachingValueProvider) paramValue;
      if (!typedValue.isComputed()) {
        // in order to preserve laziness we tell the value provider to assert the type when
        // computation is triggered
        typedValue.addValueAssertion(
            new ValueAssertion() {
              @Override
              public void check(SoyValue value) {
                checkValueType(param, value, node);
              }
            });
        return;
      }
    } else if (param.hasDefault() && paramValue.resolve() instanceof UndefinedData) {
      // Default parameters are undefined if they're unset.
      return;
    }
    checkValueType(param, paramValue.resolve(), node);
  }
855767
public static boolean isFunctionOfType(Expression expr, FunctionDefinition.Type type) {
		return expr instanceof CallExpression &&
			((CallExpression) expr).getFunctionDefinition().getType() == type;
	}
886835
private boolean checkForMapValue(TabularType pType) {
        CompositeType rowType = pType.getRowType();
        // Two entries in the row: "key" and "value"
        return rowType.containsKey(TD_KEY_VALUE) && rowType.containsKey(TD_KEY_KEY) && rowType.keySet().size() == 2;
    }
1271106
public boolean recordDefineType(JSTypeExpression type) {
    if (type != null &&
        !currentInfo.isConstant() &&
        !currentInfo.isDefine() &&
        recordType(type)) {
      currentInfo.setDefine(true);
      populated = true;
      return true;
    } else {
      return false;
    }
  }