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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user