Skip to content

Fix/annotated type assertions#24

Merged
wolfy-j merged 2 commits intomainfrom
fix/annotated-type-assertions
Mar 20, 2026
Merged

Fix/annotated type assertions#24
wolfy-j merged 2 commits intomainfrom
fix/annotated-type-assertions

Conversation

@wolfy-j
Copy link
Contributor

@wolfy-j wolfy-j commented Mar 20, 2026

  • corrupted states after returning to pool during yield
  • unsanctioned crash on invalid type definitions

wolfy-j added 2 commits March 18, 2026 11:41
…untime validation

Annotated.Kind() delegates to Inner.Kind(), causing panics when code
checks Kind() then does unsafe type assertions like m.(*Optional) on
a value that is actually *Annotated wrapping an Optional.

Unwrap Annotated before structural dispatch in union, optional,
intersection construction and in subtype normalization and table
type checking.

Also add missing *typ.Interface case to runtime validateValue and
validateWithErrorResolver so that bare `table` type annotations
accept any LTable value.
When an LState was returned to the pool after a coroutine yield,
the yielded field remained true. All three pool retrieval paths
(resetLState, newLState, newLStateWithGAndAlloc) now clear it.
@wolfy-j wolfy-j merged commit 004c69a into main Mar 20, 2026
wolfy-j added a commit that referenced this pull request Mar 20, 2026
PR #24 introduced pool reset code referencing the old `yielded` bool
field, but PR #23 replaced it with `yieldState` uint8. Use proper
yieldNone/yieldSystem/yieldUser constants throughout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant