test(ir): lock protocol/impl lookup before A4.2 extraction (A4.2 scaffolding step 1)
Test-first scaffolding ahead of extracting src/ir/protocols.zig — no code change
to the refactor targets (registerProtocolDecl / registerImplBlock /
registerParamImpl / hasImplPlain / tryUserConversion / tryPackImplMatch /
createProtocolThunk / buildProtocolValue).
Adds 4 .ir snapshots (only 0400 existed for 04xx), each captured surgically via
`sx ir | normalize_ir`, path-free, idempotent, and print-free at IR-gen time
(the 0524 contamination lesson):
- 0413-protocols-parameterized-protocol-value parameterized protocol
(registerParamImpl + tryUserConversion)
- 0414-protocols-generic-struct-protocol-erase generic-struct erasure
(createProtocolThunk + buildProtocolValue)
- 0416-protocols-auto-type-erasure auto erasure (buildProtocolValue + thunk)
- 0528-packs-protocol-pack-methods pack-variadic impl (tryPackImplMatch)
With existing 0400 (impl-for-builtin) they pin erasure (auto/generic/builtin) +
parameterized + pack-variadic + dispatch; the 0410/0411/0412 runtime anchors
already pin cross-module visibility + duplicate-impl rejections.
Adds 1 unit test via the public surface (no new exposure, mirroring A4.1
sub-step 1): registerProtocolDecl -> getProtocolInfo builds the dispatch method
table (method names, param_types with self excluded, concrete vs Self return
with ret_is_self + *void encoding). The impl-lookup / conversion plan-object
tests (hasImplPlain, tryUserConversion, tryPackImplMatch — private today) land
with the registry in sub-step 2.
zig build, zig build test, tests/run_examples.sh (357/0) all green.
This commit is contained in:
4077
examples/expected/0413-protocols-parameterized-protocol-value.ir
Normal file
4077
examples/expected/0413-protocols-parameterized-protocol-value.ir
Normal file
File diff suppressed because it is too large
Load Diff
4092
examples/expected/0414-protocols-generic-struct-protocol-erase.ir
Normal file
4092
examples/expected/0414-protocols-generic-struct-protocol-erase.ir
Normal file
File diff suppressed because it is too large
Load Diff
5142
examples/expected/0416-protocols-auto-type-erasure.ir
Normal file
5142
examples/expected/0416-protocols-auto-type-erasure.ir
Normal file
File diff suppressed because it is too large
Load Diff
4033
examples/expected/0528-packs-protocol-pack-methods.ir
Normal file
4033
examples/expected/0528-packs-protocol-pack-methods.ir
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user