fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Confusing error message in case of typo in a argument type

Open fridis opened this issue 1 year ago • 0 comments

See this example which uses i34 instead of i32

p is
  f(x i32) i32 => abstract

q : p is
  redef f(x i34) => 42

results in a confusing message

 > ./build/bin/fz test_argcnt.fz 

/home/fridi/fuzion/work/test_argcnt.fz:5:9: error 1: Wrong number of arguments in redefined feature
  redef f(x i34) => 42

In 'q.f' that redefines 'p.f' argument count is 2, argument count should be 1 Original feature declared at /home/fridi/fuzion/work/test_argcnt.fz:2:3:
  f(x i32) i32 => abstract


one error.

It should better explain that the original feature requires no type argument and one value argument, while the redefinition has one free type argument i34 and one value argument.

Would be great to suggest changing the free type i34 into the concrete type i32.

fridis avatar Aug 23 '24 11:08 fridis