feat: include method arity in missing method runtime error messages
Add helper functions `canonicalSymbol` and `methodArgumentsString` to extract and format the argument count from symbol names. Update the runtime error message in `runInterpreter` to append the arity (e.g., "with 0 arguments", "with 2 arguments", "with 1 argument") when a class does not implement a method. Add new test cases for missing methods with one, two, and eleven arguments, and update all existing test expectations to include the arity suffix.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Base {}
|
||||
|
||||
class Derived is Base {
|
||||
foo { super.doesNotExist } // expect runtime error: Base does not implement method 'doesNotExist'.
|
||||
foo { super.doesNotExist } // expect runtime error: Base does not implement method 'doesNotExist' with 0 arguments.
|
||||
}
|
||||
|
||||
(new Derived).foo
|
||||
|
||||
Reference in New Issue
Block a user