002 keyword collision

✓ Passing Passing: the compiler rejects this program as expected.

Code

input.k

Supporting Files

lib_a.kz
lib_b.kz

Actual compiler output

ERROR: Ambiguous keyword 'process' - defined in:
  - lib_a:process (from lib_a)
  - lib_b:process (from lib_b)
error: AmbiguousKeyword
/Users/larsde/src/koru/src/keyword_registry.zig:100:17: 0x1044412d7 in resolveKeyword (koruc)
                return error.KeywordCollision;
                ^
/Users/larsde/src/koru/src/keyword_registry.zig:389:13: 0x104440cd7 in resolveInPath (koruc)
            return error.AmbiguousKeyword;
            ^
/Users/larsde/src/koru/src/keyword_registry.zig:202:13: 0x1044428af in resolveInItem (koruc)
            try resolveInPath(&flow.invMut().path, registry, allocator, home_module, home_items);
            ^
/Users/larsde/src/koru/src/keyword_registry.zig:188:9: 0x104442c5f in resolveInASTWithLookup (koruc)
        try resolveInItem(item, registry, allocator, home_module, home_items, all_items);
        ^
/Users/larsde/src/koru/src/keyword_registry.zig:173:5: 0x104442cf7 in resolveInAST (koruc)
    try resolveInASTWithLookup(items, registry, allocator, home_module, items, items);
    ^
/Users/larsde/src/koru/src/main.zig:7037:9: 0x1045e6c23 in main (koruc)
        try keyword_registry.resolveInAST(@constCast(source_file.items), &kw_registry, parse_allocator, source_file.main_module_name);
        ^

Frontend must reject with:

Ambiguous keyword

Expected patterns

Each line is a regex that must match the compiler error output.

# Test 330_002: Ambiguous keyword collision must produce a user-facing diagnostic
# naming the keyword and both defining modules, plus pin the call chain.
# Hex addresses and exact line numbers in src/*.zig shift with every build.
^ERROR: Ambiguous keyword 'process' - defined in:$
^  - lib_a:process \(from lib_a\)$
^  - lib_b:process \(from lib_b\)$
^error: AmbiguousKeyword$
keyword_registry\.zig:[0-9]+:[0-9]+: 0x[0-9a-f]+ in resolveKeyword \(koruc\)
keyword_registry\.zig:[0-9]+:[0-9]+: 0x[0-9a-f]+ in resolveInPath \(koruc\)
keyword_registry\.zig:[0-9]+:[0-9]+: 0x[0-9a-f]+ in resolveInAST \(koruc\)
main\.zig:[0-9]+:[0-9]+: 0x[0-9a-f]+ in main \(koruc\)

Flows

flow ~process click a branch to expand · @labels scroll to their anchor
process

Test Configuration

MUST_ERROR

koru.json: