Add types.sx gradual type system spec module with 44 tests

Implements subtype checking, type inference, type narrowing, and
component call-site checking. All type logic is in types.sx (spec),
bootstrapped to every host. Adds test-types.sx with full coverage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 17:06:09 +00:00
parent 4c4806c8dd
commit e5dbe9f3da
6 changed files with 979 additions and 448 deletions

View File

@@ -307,6 +307,14 @@ def component_affinity(c):
return getattr(c, 'affinity', 'auto')
def component_param_types(c):
return getattr(c, 'param_types', None)
def component_set_param_types(c, d):
c.param_types = d
def macro_params(m):
return m.params
@@ -1428,6 +1436,7 @@ SPEC_MODULES = {
"router": ("router.sx", "router (client-side route matching)"),
"engine": ("engine.sx", "engine (fetch/swap/trigger pure logic)"),
"signals": ("signals.sx", "signals (reactive signal runtime)"),
"types": ("types.sx", "types (gradual type system)"),
}
EXTENSION_NAMES = {"continuations"}