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:
Stephen Belanger
2016-03-13 03:14:19 +00:00
parent b9b9611a8c
commit 7913424c1c
3 changed files with 38 additions and 20 deletions
@@ -0,0 +1,11 @@
class Foo {
construct new() {}
foo() {}
foo() {} // expect error
static bar() {}
static bar() {} // expect error
baz() {}
static baz() {}
}