pub enum LayoutError {
UnsupportedMemberKind(SymbolKind, String),
UnsupportedType(String),
NonConstantCheckerOutputInitial(String),
}Expand description
The loud, typed error this and every later layout task returns instead of
silently skipping a member kind this plan claims to handle (ARCHITECTURE
§7 item 9 applied to SymbolKind).
Deviation from the plan’s literal sym. call-site restriction: the
plan’s Task 4 prose says build_template_layout touches no Symbol
method outside {members, kind, value_type, initializer}, but this
variant’s own field is documented as “a hierarchical-ish name for
diagnosis”, and ST-126’s own ledger text lists Symbol::name() as part
of STATE’s allowed hierarchy-walking API surface. name() is called only
on this (in practice unreachable this wave, since a real Variable/
Net/Port symbol always yields a value_type()) diagnostic path, never
on the per-member happy path.
Variants§
UnsupportedMemberKind(SymbolKind, String)
A member this builder’s kind-filter does accept (Variable/Net/
Port) but that itself failed to yield a queryable value – e.g.
Symbol::value_type() returning None for a symbol the filter
otherwise believed was a value. Carries the offending kind and a
hierarchical-ish name for diagnosis. Never constructed for a kind the
filter excludes on purpose (ST-072’s exclusion is not an error).
UnsupportedType(String)
Task 6: a member whose value_type()/port_type() shape this builder
cannot yet lay out – a dynamic array, queue, or associative array
(rejected by the explicit Type::is_dynamically_sized_array()
predicate check, never inferred from another predicate being false);
a class handle, string, chandle, event, virtual interface, a
multi-dimensional fixed unpacked array (whose per-row element is
itself another unpacked array), or a real/shortreal/realtime
(review fix r1 rejected the first three via bit_width() == 0;
review fix r3 replaced that with the more general !is_integral()
gate – real/shortreal/realtime have a NONZERO bit_width()
(64/32/64, per Type::getBitWidth) despite having no floating-point
representation implemented this wave, so the old zero-width test
alone let them fall through into ordinary 4-state slot machinery
with a silently dropped initializer; is_integral() is false for
every one of these shapes and true for everything this wave does
support, so one gate now gets both); or an otherwise-supported
integral member whose bit width does not fit u16 (review fix r3:
previously silently clamped to u16::MAX instead of rejected, which
for a Wide scalar also undersized the arena allocation itself, since
word_count was derived from the clamped value). Carries a
hierarchical-ish name for diagnosis. A loud Err, never a guessed
slot or a panic reading a nonexistent fixed bound.
NonConstantCheckerOutputInitial(String)
A checker output formal whose initial value (output int ctr = x;,
LRM 17.2) is not a constant: it is evaluated in the instantiation’s
context, and only a constant one is lowered – rejected rather than
left at the type’s default.