v6 Semantics

Type checker stack

  • infer first, then validate consistency
  • unknown lets the checker continue without spurious cascades
  • nil can flow into typed locations

Core invariants

  • variable declarations are either annotated or inferable
  • function signatures are mandatory
  • return checks 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 type for ambiguous declarations
  • type mismatch and specialized operand errors
  • arity mismatch and call of non-function

Focus for this module

  • static phase catches as much as possible
  • VM should receive better-typed bytecode shape
1 / 1
Use arrow keys or click edges to navigate. Press H to toggle help, F for fullscreen.