M2 icon indicating copy to clipboard operation
M2 copied to clipboard

badClass produces incorrect error message

Open pzinn opened this issue 1 year ago • 0 comments

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.

pzinn avatar Nov 09 '23 22:11 pzinn