Search in sources :

Example 1 with ExpressionCompatibleWithType

use of com.github.javaparser.symbolsolver.resolution.typeinference.constraintformulas.ExpressionCompatibleWithType in project javaparser by javaparser.

the class TypeInference method constraintSetFromArgumentsSubstitution.

private ConstraintFormulaSet constraintSetFromArgumentsSubstitution(List<ResolvedType> Fs, List<Expression> es, Substitution theta, int k) {
    ConstraintFormulaSet constraintFormulaSet = ConstraintFormulaSet.empty();
    for (int i = 0; i < k; i++) {
        Expression ei = es.get(i);
        ResolvedType fi = Fs.get(i);
        ResolvedType fiTheta = typeWithSubstitution(fi, theta);
        constraintFormulaSet = constraintFormulaSet.withConstraint(new ExpressionCompatibleWithType(typeSolver, ei, fiTheta));
    }
    return constraintFormulaSet;
}
Also used : ExpressionCompatibleWithType(com.github.javaparser.symbolsolver.resolution.typeinference.constraintformulas.ExpressionCompatibleWithType) ExpressionHelper.isStandaloneExpression(com.github.javaparser.symbolsolver.resolution.typeinference.ExpressionHelper.isStandaloneExpression) ResolvedType(com.github.javaparser.resolution.types.ResolvedType)

Aggregations

ResolvedType (com.github.javaparser.resolution.types.ResolvedType)1 ExpressionHelper.isStandaloneExpression (com.github.javaparser.symbolsolver.resolution.typeinference.ExpressionHelper.isStandaloneExpression)1 ExpressionCompatibleWithType (com.github.javaparser.symbolsolver.resolution.typeinference.constraintformulas.ExpressionCompatibleWithType)1