// deal with varags, change the last argument to a list if its not a pattern
Expression last = formals.get(formals.size() - 1);
if (last.isTypedVariable()) {
org.rascalmpl.ast.Type oldType = last.getType();
ISourceLocation origin = last.getLocation();
Structured newType = ASTBuilder.make("Type","Structured", origin, ASTBuilder.make("StructuredType",origin, ASTBuilder.make("BasicType","List", origin), Arrays.asList(ASTBuilder.make("TypeArg","Default", origin,oldType))));
last = ASTBuilder.make("Expression","TypedVariable",origin, newType, last.getName());
formals = replaceLast(formals, last);
}
else if (last.isQualifiedName()) {
ISourceLocation origin = last.getLocation();