List<TypeVariable> vars = klassType.getTypes();
for (int i = 0; i < vars.size(); i++) {
TypeVariable var = vars.get(i);
Vertex vertex = typeVarMap.get(var);
if (i < types.size() && vertex != null) {
TypeExpression expr = types.get(i);
for (IRubyObject a : vertex.getTypeSet()) {
if (!resolveMethodArg(template, klassType, expr, receiver, a)) {
return false;
}
}
}
}
}
}
return true;
}
case SCOPED_IDENTITY:
case ABSOLUTE_IDENTITY:
case RELATIVE_IDENTITY: {
IRubyObject guard = resolveIdentity(template, (TypeIdentity) argType);
return (guard instanceof RubyClass) && arg.isKindOf((RubyClass) guard);
}
case UNION:
for (TypeExpression expr : (TypeUnion) argType) {
if (resolveMethodArg(template, classType, expr, receiver, arg)) {
return true;
}
}
return false;
case TUPLE: {
TypeTuple tuple = (TypeTuple) argType;
for (TypeExpression expr : tuple.getList()) {
if (resolveMethodArg(template, classType, expr, receiver, arg)) {
return true;
}
}
return false;
}
case SPLAT: {
TypeSplat splat = (TypeSplat) argType;
TypeExpression expr = splat.getExpression();
if (expr == null) {
return true;
} else if (expr.getType() == TypeExpression.Type.VARIABLE) {
return resolveMethodArg(template, classType, expr, receiver, arg);
} else if (arg instanceof Array) {
Array array = (Array) arg;
for (Vertex v : array.getElements()) {
for (IRubyObject a : v.getTypeSet()) {