From 8b613af96bba1feb52217527e5b7be4c85918c3c Mon Sep 17 00:00:00 2001 From: agra Date: Tue, 23 Jun 2026 08:05:44 +0300 Subject: [PATCH] docs: close issue 0171 as not-a-bug (wrong casing: any vs Any) The type-erased value type is spelled Any (capital), per specs.md and type_resolver.zig. Lowercase 'any' is an undefined name that resolves to an empty-struct stub, which is why ?any appeared to silently discard the value. ?Any round-trips correctly (present/absent/unwrap all work), so there is no Any-TypeId canonicalization bug. Reword the 0165 cross-ref accordingly. --- .../0165-parenthesized-nested-optional-malformed.md | 5 +++-- issues/0171-optional-any-child-not-canonicalized.md | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/issues/0165-parenthesized-nested-optional-malformed.md b/issues/0165-parenthesized-nested-optional-malformed.md index ea179eeb..110637c0 100644 --- a/issues/0165-parenthesized-nested-optional-malformed.md +++ b/issues/0165-parenthesized-nested-optional-malformed.md @@ -14,8 +14,9 @@ > Genuine nested optionals via alias (`Opt :: ?i64; ?Opt`) work and round-trip. > Regressions: `examples/optionals/0911-nested-optional-via-alias.sx`, > `examples/diagnostics/1195-diagnostics-err-parenthesized-optional-tuple.sx`. -> Verified by 3 adversarial reviews. (Adjacent pre-existing bug found + filed: -> 0171 `?any` child not canonicalized.) +> Verified by 3 adversarial reviews. (A review noted `?any` over-rejection; +> that turned out to be a casing non-bug — lowercase `any` is an undefined name, +> the type is `Any`; see 0171, closed NOT-A-BUG.) ## Symptom diff --git a/issues/0171-optional-any-child-not-canonicalized.md b/issues/0171-optional-any-child-not-canonicalized.md index 9d6c3e32..4c261c50 100644 --- a/issues/0171-optional-any-child-not-canonicalized.md +++ b/issues/0171-optional-any-child-not-canonicalized.md @@ -1,5 +1,16 @@ # 0171 — `?any` optional child is a non-canonical `any` TypeId (box-into-any rule misses, value silently discarded) +> **RESOLVED — NOT A BUG (wrong casing in the repro).** The type-erased value +> type is spelled **`Any`** (capital A), not lowercase `any` (specs.md §Types; +> `src/ir/type_resolver.zig`: `if name == "Any" return .any`). Lowercase `any` +> is an UNDEFINED type name that resolves to an empty-struct stub — which is why +> `?any` appeared to "silently discard" / mis-resolve. The real `Any` optional +> child works correctly: `?Any` round-trips — `x : ?Any = 42` tests present, a +> `null` one tests absent, and `x!` unwraps. There is no `Any`-TypeId +> canonicalization bug. (The confusing diagnostic for a lowercase `?any` — +> "payload type is 'any'" instead of "unknown type 'any'" — is a minor +> undefined-name-in-optional-child message-quality nit, not this issue.) + ## Symptom An optional whose child is `any` (`?any`) is broken. Baseline (before the issue