Repository navigation
fix(specs): generic collections speak fn-level comptime params (Refs #11940 #12000) - #12151
Merged
Merged
Conversation
…11940 #12000) Convert the convertible members of #11940's 14-spec blocked table to the fn-level comptime grammar #12000 landed, following box.t27: types bind at each fn (fn some(comptime T: type, value: T) -> Option(T)) and call sites pass them explicitly (some(i64, 42)). maybe's bind/map take the function type as a second comptime param (bind(i64, MaybeBindFnI64, m, f)), which expresses the tie to T at the call site while ADR-008 still rejects generic fn-type aliases. Beyond the signatures, the never-compiled bodies needed the emitter's Zig shapes: .field = value inits, &[_]T{} empty slices, AutoHashMap, and renames forced by the target language (Result's E collided with math::constants' Euler E in the use-resolved source; its error field/param are Zig keywords). reader/writer/state stay untouched: their fn-typed fields/params and closure bodies are sub-slices 2+3, compiler-side. t27c test-report, measured with a current build (the shared t27-build binary predates #12000 and blocks box.t27 itself): maybe 14/14, either 15/15, result 10/10, tuple 9/9, queue 5/5, option 4/4, set 4/4 (1 pre-existing vacuous), io 2/2 -- eight green. tree now blocks on its self-referential value field (needs indirection), ring_buffer on the cross-module Option(T) reference and an allocator-backed create_buffer, btree on allocator values at call sites: each advanced to its own next defect, recorded in .trinity/seals. 21 seal files resealed (both naming copies); seal --verify MATCH on all eleven.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The generic collections (maybe, io and friends) converted to fn-level comptime type params per box.t27's pattern. The undeclared-identifier defect resolved on the convertible specs.