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:
Gavin Schulz
2015-01-04 19:42:11 +00:00
parent 1951059c8f
commit 9fe43fec45
10 changed files with 64 additions and 16 deletions
@@ -4,4 +4,4 @@ class Foo {
class Bar is Foo {}
Bar.methodOnFoo // expect runtime error: Bar metaclass does not implement method 'methodOnFoo'.
Bar.methodOnFoo // expect runtime error: Bar metaclass does not implement method 'methodOnFoo' with 0 arguments.