docs(metatype): duplicate-variant validation done; tidy Next step list
This commit is contained in:
@@ -93,8 +93,9 @@ Pick any (independent):
|
|||||||
add `` .`struct ``/`` .`tuple `` to the `TypeInfo` enum in `meta.sx`, teach
|
add `` .`struct ``/`` .`tuple `` to the `TypeInfo` enum in `meta.sx`, teach
|
||||||
`reflectTypeInfo` to build them, and teach `defineEnum` (→ a `defineType`) to
|
`reflectTypeInfo` to build them, and teach `defineEnum` (→ a `defineType`) to
|
||||||
decode them. Round-trips a struct through `define` once it lands.
|
decode them. Round-trips a struct through `define` once it lands.
|
||||||
- **Validation + loud diagnostics** (remaining) — duplicate variant names, a
|
- **Validation + loud diagnostics** (remaining) — ~~duplicate variant names~~ DONE
|
||||||
`declare()` never `define()`d (hard error at end of comptime), use-before-define.
|
(`define` bails naming the dup; `examples/1180`). Still pending: a `declare()`
|
||||||
|
never `define()`d (hard error at end of comptime), use-before-define.
|
||||||
|
|
||||||
### make_enum follow-ups (deferred capability gaps — NOT crashes; clean diagnostics)
|
### make_enum follow-ups (deferred capability gaps — NOT crashes; clean diagnostics)
|
||||||
`make_enum` itself is DONE (see Last completed step). Remaining adjacent
|
`make_enum` itself is DONE (see Last completed step). Remaining adjacent
|
||||||
@@ -114,13 +115,6 @@ capabilities would let the variant list be built more freely; both error cleanly
|
|||||||
before the return is unresolved. Workaround: build the list inline in the return,
|
before the return is unresolved. Workaround: build the list inline in the return,
|
||||||
or use a non-generic `() -> Type` builder (whose whole body is evaluated — this
|
or use a non-generic `() -> Type` builder (whose whole body is evaluated — this
|
||||||
is what `examples/0620` uses). Probe `.sx-tmp/probe_me5.sx`.
|
is what `examples/0620` uses). Probe `.sx-tmp/probe_me5.sx`.
|
||||||
- **Widen `type_info` / `TypeInfo` past `` `enum ``** — struct/tuple variants:
|
|
||||||
add `` .`struct ``/`` .`tuple `` to the `TypeInfo` enum in `meta.sx`, teach
|
|
||||||
`reflectTypeInfo` to build them, and teach `defineEnum` (→ a `defineType`) to
|
|
||||||
decode them. Round-trips a struct through `define` once it lands.
|
|
||||||
- **Validation + loud diagnostics** (remaining) — duplicate variant names, a
|
|
||||||
`declare()` never `define()`d (hard error), use-before-define. (By-value
|
|
||||||
self-reference already rejected — issue 0139.)
|
|
||||||
|
|
||||||
## Known issues
|
## Known issues
|
||||||
- issue 0140 — comptime type-construction bail panicked instead of diagnosing —
|
- issue 0140 — comptime type-construction bail panicked instead of diagnosing —
|
||||||
@@ -134,6 +128,10 @@ capabilities would let the variant list be built more freely; both error cleanly
|
|||||||
`examples/1178` locks it).
|
`examples/1178` locks it).
|
||||||
|
|
||||||
## Log
|
## Log
|
||||||
|
- **Duplicate variant-name validation.** Two same-named variants in a constructed
|
||||||
|
enum used to silently succeed (ambiguous construction/match). `defineEnum` now
|
||||||
|
bails naming the duplicate; `evalComptimeType` renders it (post-0140).
|
||||||
|
`examples/1180` locks it. Suite green (680).
|
||||||
- **Comptime subslice over non-string aggregates.** `arr[lo..hi]` at comptime
|
- **Comptime subslice over non-string aggregates.** `arr[lo..hi]` at comptime
|
||||||
used to bail (interp `.subslice` was string-only) and the open-ended `hi` came
|
used to bail (interp `.subslice` was string-only) and the open-ended `hi` came
|
||||||
from a `.length` op that misread a 2-elem array as a `{ptr,len}` fat pointer.
|
from a `.length` op that misread a 2-elem array as a `{ptr,len}` fat pointer.
|
||||||
|
|||||||
Reference in New Issue
Block a user