Skip to content

D91 (§17.5) regressed on the release compiler: comptime match Target.os is "runtime value is not available at comptime" (#2124 implemented it, #2248 closed) #2949

Closed

Description

@ehartford

Conformance audit 2026-11-02. §17.5 (D91): Target.os and Target.arch are compile-time constants; a per-target value is an exhaustive comptime match. The spec's own example (§17.5, pub const EAGAIN: i32 = comptime match Target.os: …) does not compile on the installed compiler (main 038c50c), with or without use std.sysinfo, in let or pub const form:

pub const NAME: str = comptime match Target.os:
    .Macos => "mac"
    .Linux => "linux"
    .Windows => "win"
    .Wasi => "wasm"
print(NAME)
error: runtime value is not available at comptime

#2248 ("stage1 and the release compiler resolve a bare Target differently") is closed, but the release compiler shows exactly its symptom. Needs a behavior fixture that runs under the release compiler (the lane :test runs), not only under stage1.

Activity

  1. added
    bug
    spec-gap
    on Nov 2, 2026
  2. ehartford commented on Nov 3, 2026

    @ehartford
    ContributorAuthor

    Three-way check. Both compiler generations refuse bare Target.os without use std.os.Target: stage1 says "requires an explicit import; add: use std.os.Target" (the §18.1 gate), the release compiler said "runtime value is not available at comptime" because its unit never parsed std.os (std is served as interfaces), so the comptime evaluator found no declaration at all. The spec example omits the import because §18.1 tier 5 (D29, #752) resolves a unique std name without one; that tier is not active. So: the example is right under the spec, the compiler lacks #752, and the release message was wrong.

    Done on stack #3008 (layer facade-error-header-hint): the comptime read of a name the unit never saw names the import gate when the gate knows the module, and otherwise says the name is undeclared here and needs its import, so both generations agree. The conformance row stays open on this issue until #752 lands; test/behavior/behav_d91_target_constants.w (with the import) pins the constants on both compilers.

  3. ehartford commented on Nov 7, 2026

    @ehartford
    ContributorAuthor

    Fixed in #3056 (merged as afbdbb1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugspec-gap

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions