STATUS: PARSER WORK PENDING / FEATURE UNCERTAIN
Code
// Test 210_039: File Source Syntax
// Validates the [type]"path" syntax for reading files as Source at compile time
//
// Syntax: event [type]"path"
const std = @import("std");
// Event that takes Source parameter
~[comptime|transform]tor render.file {
source: Source[text],
program: *const Program,
allocator: std.mem.Allocator
}
| transformed *const Program
~proc render.file|zig {
// Just print what we received to prove file was read
std.debug.print("File content: '{s}'\n", .{source.text});
std.debug.print("Phantom type: '{s}'\n", .{source.phantom_type orelse "none"});
// Return program unchanged
return .{ .transformed = program };
}
// Test: Read file content using [type]"path" syntax
~render.file [text]"hello.txt"
| transformed _ |> _
Supporting Files
Hello from the file source!Flows
Test Configuration
Awaiting ruling:
Do compiler annotations on TYPE positions live or die — build `[]`-annotation extraction into its own AST field, or drop the surface and allow bare types only? Compiler annotations are a different system from phantom types: phantoms (`<>`) are value-level, flow at runtime and trigger discharge; annotations (`[]`) are declaration-level metadata for the compiler and transforms (`[!]`, `[T:u32;N:1024]`, `[comptime|transform]`, `Source[text]`). See docs/COMPILER_ANNOTATIONS.md for the catalog. Why this is red rather than merely unbuilt: the phantom cutover (2026-05-29) removed the only parser path extracting `[...]` from type strings — a path doing double duty for phantoms and annotations, which is precisely the conflation the two-system split was meant to end. Removing it for phantoms also removed the only thing stripping annotations before Zig emission, so `Source[text]` now reaches Zig, which reads it as array indexing into a type and rejects it. You were recorded as on the fence and the call was deferred. It resolves together with 310_040 (`| number u64[\d+]` literate annotations) — same decision, two witnesses. Blocks: this test, 310_040, and whether `Source[text]`-style hints exist as a surface at all.