}
public void
checkMethodInvocation(final JCMethodInvocation invocation)
{
PQLMagicSubexpr checker =
new PQLMagicSubexpr() {
@Override
public void
handleContains(JCExpression set, JCExpression element)
{
set.type = boxRecursively(set.type.elimQTyVars());
element.type = element.type.elimQTyVars();
//set.type.unifyWith(collectionTypeOf(element.type), attr.types);
if (!attr.types.isSubtype(set.type, collectionTypeOf(element.type))) {
attr.log.error(invocation.pos(), "prob.found.req", JCDiagnostic.fragment("incompatible.types"), set.type, collectionTypeOf(element.type));
}
}
@Override
public void
handleMapGet(JCExpression map, JCExpression key)
{
map.type = boxRecursively(map.type.elimQTyVars());
key.type = key.type.elimQTyVars();
invocation.type = invocation.type.elimQTyVars();
final Type expected_type = mapTypeOf(key.type, invocation.type);
//expected_type.unifyWith(map.type, attr.types);
if (!attr.types.isSubtype(map.type, expected_type)) {
attr.log.error(invocation.pos(), "prob.found.req", JCDiagnostic.fragment("incompatible.types"),
map.type, expected_type);
}
}
@Override
public void
handleSize(JCExpression container)
{
container.type = container.type.elimQTyVars();
}
@Override
public void
handleRange(JCExpression first, JCExpression last)
{
}
@Override
public void
handleRangeContains(JCExpression first, JCExpression last, JCExpression body)
{
}
};
checker.process(invocation);
}