Add (name :as type) annotation syntax for defcomp params

parse-comp-params now recognizes (name :as type) — a 3-element list
with :as keyword separator. Type annotations are stored on the
Component via component-param-types and used by types.sx for call-site
checking. Unannotated params default to any. 428/428 tests pass (50
types tests including 6 annotation tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-11 17:12:54 +00:00
parent b82fd7822d
commit 8a530569a2
5 changed files with 147 additions and 31 deletions

View File

@@ -142,6 +142,8 @@ class PyEmitter:
"component-has-children?": "component_has_children",
"component-name": "component_name",
"component-affinity": "component_affinity",
"component-param-types": "component_param_types",
"component-set-param-types!": "component_set_param_types",
"macro-params": "macro_params",
"macro-rest-param": "macro_rest_param",
"macro-body": "macro_body",