Check array literals (bare, typed, sized) #56

Closed
opened 2026-09-10 22:13:52 +00:00 by jacksonopp · 0 comments
Owner

Type-check Expr::ArrayLiteral's three fields -- element_type when present is the source of truth (every element must match it), otherwise every element must agree on one inferred type; size when present must be Int. Result type is List(T) / the sized array form.

Dependency: no TyKind variant exists yet for a generic container instantiation (checked -- only Bool/Enum/Error/Float/Fn/Int/String/Struct/Type/TypeParam/Unit). Deciding how List(T)/the sized array form gets represented as a concrete Ty is tracked separately in #69 (not #6, which only covers T: type params / List(T)-shaped calls as ordinary function calls, not this) -- needs that settled first.

Type-check Expr::ArrayLiteral's three fields -- element_type when present is the source of truth (every element must match it), otherwise every element must agree on one inferred type; size when present must be Int. Result type is List(T) / the sized array form. **Dependency:** no TyKind variant exists yet for a generic container instantiation (checked -- only Bool/Enum/Error/Float/Fn/Int/String/Struct/Type/TypeParam/Unit). Deciding how List(T)/the sized array form gets represented as a concrete Ty is tracked separately in #69 (not #6, which only covers T: type params / List(T)-shaped calls as ordinary function calls, not this) -- needs that settled first.
jacksonopp added this to the twill project 2026-09-10 22:20:36 +00:00
jacksonopp removed this from the twill project 2026-10-04 02:28:22 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jacksonopp/twill#56
No description provided.