feat: replace generic BufferFind with dedicated hasMethod for duplicate detection
Replace the generic `wrenIntBufferFind` function with a specialized `hasMethod` helper that performs exact method symbol matching in the compiler. This change removes the generic `BufferFind` macro from the buffer utility system and introduces a focused implementation in `wren_compiler.c` that directly compares method symbols using `memcmp`. The error message for duplicate methods is also simplified to exclude the module name. Additionally, a new test file `duplicate_methods.wren` is added to verify error handling for duplicate instance and static method definitions.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
construct new() {}
|
||||
foo() {}
|
||||
foo() {} // expect error
|
||||
|
||||
static bar() {}
|
||||
static bar() {} // expect error
|
||||
|
||||
baz() {}
|
||||
static baz() {}
|
||||
}
|
||||
Reference in New Issue
Block a user