feat: switch method signatures to parenthesized parameter notation and update error messages
The method signature format has been changed from space-counted arity (e.g., "== ") to explicit parenthesized parameter lists (e.g., "==(_)"). This required updating the MAX_METHOD_SIGNATURE calculation to account for parentheses and parameter separators, replacing the old copyName helper with a new Signature struct and SignatureType enum, and rewriting the methodNotFound error message to display the full signature string instead of reconstructing arity from trailing spaces. All core method registrations in wren_core.c, wren_io.c, and corresponding test expectations have been updated to use the new signature format.
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
class Foo {}
|
||||
|
||||
(new Foo).someUnknownMethod // expect runtime error: Foo does not implement method 'someUnknownMethod' with 0 arguments.
|
||||
(new Foo).someUnknownMethod // expect runtime error: Foo does not implement 'someUnknownMethod'.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo {}
|
||||
|
||||
(new Foo).someUnknownMethod(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) // expect runtime error: Foo does not implement method 'someUnknownMethod' with 11 arguments.
|
||||
(new Foo).someUnknownMethod(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11) // expect runtime error: Foo does not implement 'someUnknownMethod(_,_,_,_,_,_,_,_,_,_,_)'.
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo {}
|
||||
|
||||
(new Foo).someUnknownMethod(1, 2) // expect runtime error: Foo does not implement method 'someUnknownMethod' with 2 arguments.
|
||||
(new Foo).someUnknownMethod(1, 2) // expect runtime error: Foo does not implement 'someUnknownMethod(_,_)'.
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo {}
|
||||
|
||||
(new Foo).someUnknownMethod(1) // expect runtime error: Foo does not implement method 'someUnknownMethod' with 1 argument.
|
||||
(new Foo).someUnknownMethod(1) // expect runtime error: Foo does not implement 'someUnknownMethod(_)'.
|
||||
@@ -1,3 +1,3 @@
|
||||
class Foo {}
|
||||
|
||||
Foo.bar // expect runtime error: Foo metaclass does not implement method 'bar' with 0 arguments.
|
||||
Foo.bar // expect runtime error: Foo metaclass does not implement 'bar'.
|
||||
Reference in New Issue
Block a user