Files
codebase-memory-mcp/internal/cbm
Martin Vogel ab04546fa2 fix(resolver): a Perl code reference under an operator is USAGE
The dynamic lane made resolve_usages call every admitted Perl carrier a CALL_REFERENCE, through a language clause beside the comment saying composite expressions stay USAGE. So `$flag ? \&handler : \&alternate` got two CALL_REFERENCE edges, which call_reference_language_complex_contract forbids for every language with callable references: the value is one of several.

The carrier now says it, as in the other languages: perl_lsp.c leaves may_be_call_reference false under a conditional, a binary operator or a low-precedence logical operator, parentheses aside, and the clause is gone. `my $r = \&own`, a table entry and direct arguments stay CALL_REFERENCE. mojo has 37 such edges and none is composite. resolver_source_langs gets positive and negative rows for each form.

Tests corrected, because the rule is right and the rows were not:

- The registrar in both Perl fixtures was `sub accept`. accept is a builtin and only an import overrides one (perlsub), so the adapter was right to abstain and `CALLS refs.accept` was never genuine. `perl -c` on the old fixture says "Not enough arguments for accept"; with two arguments the builtin runs and the sub does not. It is now `sub submit`, same length, and those rows are required. builtin-not-overridden-by-a-sub keeps the decoy.
- The conditional's USAGE rows named `handler` without `\&`. The carrier and every other Perl row use the `\&handler` span, and the rows were never found, so nothing had checked them. Corrected and required.
- perl_exact_coderef_is_call_reference-1 is recovered and true: promoted.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-02 21:22:52 +01:00
..