return ReductionResult.empty().withConstraint(new TypeCompatibleWithType(typeSolver, s, T));
ReductionResult res = ReductionResult.empty(); List<ResolvedType> Bs = S.asReferenceType().typeParametersValues(); List<ResolvedType> As = T.asReferenceType().typeParametersValues();
ReductionResult res = ReductionResult.empty(); List<ResolvedType> Bs = S.asReferenceType().typeParametersValues(); List<ResolvedType> As = T.asReferenceType().typeParametersValues();
ReductionResult res = ReductionResult.empty(); List<ResolvedType> Bs = S.asReferenceType().typeParametersValues(); List<ResolvedType> As = T.asReferenceType().typeParametersValues();
return ReductionResult.empty().withConstraint(new TypeSubtypeOfType(typeSolver, s, t));
return ReductionResult.empty().withConstraint(new TypeSubtypeOfType(typeSolver, s, t));
return ReductionResult.empty().withConstraint(new TypeSubtypeOfType(typeSolver, s, t));
/** * From JLS 18.1.2 * * From Collections.singleton("hi"), we have the constraint formula ‹"hi" → α›. * Through reduction, this will become the constraint formula: ‹String <: α›. */ @Test public void testExpressionCompatibleWithTypeReduce1() { ResolvedTypeParameterDeclaration tp = EasyMock.createMock(ResolvedTypeParameterDeclaration.class); Expression e = new StringLiteralExpr("hi"); InferenceVariable inferenceVariable = new InferenceVariable("α", tp); ExpressionCompatibleWithType formula = new ExpressionCompatibleWithType(typeSolver, e, inferenceVariable); ConstraintFormula.ReductionResult res1 = formula.reduce(BoundSet.empty()); assertEquals( ConstraintFormula.ReductionResult.empty().withConstraint(new TypeCompatibleWithType(typeSolver, stringType, inferenceVariable)), res1); assertEquals( ConstraintFormula.ReductionResult.empty().withConstraint(new TypeSubtypeOfType(typeSolver, stringType, inferenceVariable)), res1.getConstraint(0).reduce(BoundSet.empty())); }
public static ReductionResult oneBound(Bound bound) { return empty().withBound(bound); }
public static ReductionResult oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }
public static ReductionResult trueResult() { return empty(); }
public static ReductionResult oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }
public static ReductionResult falseResult() { return empty().withBound(Bound.falseBound()); }
public static ReductionResult trueResult() { return empty(); }
public static ReductionResult falseResult() { return empty().withBound(Bound.falseBound()); }
public static ReductionResult oneBound(Bound bound) { return empty().withBound(bound); }
public static ReductionResult oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }
public static ReductionResult oneBound(Bound bound) { return empty().withBound(bound); }
public static ReductionResult falseResult() { return empty().withBound(Bound.falseBound()); }
public static ReductionResult trueResult() { return empty(); }