M2
M2 copied to clipboard
badClass produces incorrect error message
i1 : f=method(Dispatch=>{Thing,Type})
o1 = f
o1 : MethodFunction
i2 : f(1,1)
stdio:2:1:(3): error: null: expected argument 2 to be a type, but it was: 1
note the null. Overall, the way such errors are treated is not very consistent (some at d level, some with badClass).
Anyway, the culprit is this:
MultipleArgsNoOptions := (methopts,outputs) -> (
-- Note: this implementation is perfectly tuned for recursion!
methodFunction := newmethod1234c(
MethodFunction,
args -> error noMethod(methodFunction,args,outputs),
badClass methodFunction,
outputs,
null
);
methodFunction)
where methodFunction is null at the time of calling newmethod1234c.