v6 Semantics
Type checker stack
- infer first, then validate consistency
unknownlets the checker continue without spurious cascadesnilcan flow into typed locations
Core invariants
- variable declarations are either annotated or inferable
- function signatures are mandatory
returnchecks against declared return type- assignments/indexing respect assignability
- expression operators enforce operand families
Collections
- arrays are homogeneous
- maps keep stable key/value typing
- empty array/map literals need expected type context
Module + types
- exported declarations carry types
- member access checks still require alias and export
- function member calls are type-checked by exported signature
Error model
- undefined name, return/break/continue context errors still apply
cannot infer typefor ambiguous declarationstype mismatchand specialized operand errorsarity mismatchandcall of non-function
Focus for this module
- static phase catches as much as possible
- VM should receive better-typed bytecode shape
1 / 1