feat!(ltk_ritobin): AST - #185
Open
alanpq wants to merge 57 commits into
Open
Conversation
Crauzer
reviewed
Aug 27, 2026
Crauzer
reviewed
Aug 30, 2026
| #[inline(always)] | ||
| #[must_use] | ||
| /// Whether the value is container-like - (unordered) container, map, optional | ||
| pub fn is_containerlike(&self) -> bool { |
Crauzer
force-pushed
the
ritobin/ast
branch
3 times, most recently
from
August 30, 2026 10:02
0a0abc5 to
eca40b8
Compare
We report an error which is enough to flag the bin as invalid, and preserving the type as is lets us do comparisons later
removing the double error needs parser changes
type expressions in the Property node now Spanned<Option<TypeExpr>>, which means you can now distinguish between a missing expression & a broken/unresolved one, and they always have a span (points to where the expression *should* be if missing)
Ported from feat/ptch-resolve (#187), where the declaration-time type-param checks were first written; this branch's resolver already rejects container subtypes (InvalidNesting), so the missing half was the map key rule: map[link,u32] and friends now report InvalidMapKey on the declaration. The link row leaves map_keys_of_every_key_type_keep_their_pair to match: no shipped bin keys a map on a link, and ltk_meta's map constructors on main reject it (Kind::is_valid_map_key) once this branch rebases past #187. A link map key is not just unused, the client cannot express one. When the map reader synthesizes the descriptors for its nested key/value reads, only the value slot inherits the property's target class; the key's descriptor gets a null one. A link needs that target class to resolve, so a link key has nothing to resolve against - impossible by construction, not convention.
Map::empty and Optional::empty return Result since ltk_meta validates map kinds at construction; route both through to_bin's assert-with-fallback, the same way Container::empty already goes.
The declaration check was written against is_primitive because this branch predated the predicate; ltk_meta deliberately keeps key validity (a map format question) separate from primitiveness (a value model question), so ask the right one now that the rebase brought it in. Same set today.
Member
|
👉👈 |
do you sleep enough? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completely replaces old typecheck module with an AST that resolves values as it constructs
This definitely will have to be squashed