return ReductionResult.empty().withConstraint(new TypeCompatibleWithType(typeSolver, s, T));
return ReductionResult.empty().withConstraint(new TypeCompatibleWithType(typeSolver, s, T));
return ReductionResult.empty().withConstraint(new TypeCompatibleWithType(typeSolver, s, T));
List<ResolvedType> As = T.asReferenceType().typeParametersValues(); for (int i = 0; i < Bs.size(); i++) { res = res.withConstraint(new TypeSameAsType(Bs.get(i), As.get(i)));
List<ResolvedType> As = T.asReferenceType().typeParametersValues(); for (int i = 0; i < Bs.size(); i++) { res = res.withConstraint(new TypeSameAsType(Bs.get(i), As.get(i)));
List<ResolvedType> As = T.asReferenceType().typeParametersValues(); for (int i = 0; i < Bs.size(); i++) { res = res.withConstraint(new TypeSameAsType(Bs.get(i), As.get(i)));
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 oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }
public static ReductionResult oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }
public static ReductionResult oneConstraint(ConstraintFormula constraintFormula) { return empty().withConstraint(constraintFormula); }