lang 2.3: TYPE-position pack projection xs.T (tuple type + closure sig)
`xs.T` projects each pack element's protocol type-arg into a type list, usable in TYPE/signature positions: - tuple type `(..xs.T)` → e.g. `(s64, string)` (new resolveTupleTypeWithBindings) - closure sig `Closure(..xs.T) -> R` → e.g. `Closure(s64, s64) -> s64`, which contextually types a closure literal (resolveClosureTypeWithBindings now expands a protocol pack via packTypeArgs). Wired `tuple_type_expr` into `resolveTypeWithBindings` (type_bridge's tuple resolver is stateless — can't see packs). `packTypeArgs(pack_name, projection)` is shared: bare `..xs` → element types (`pack_arg_types`); `..xs.T` → each element's `impl Box(args) for elem` target_arg (`elementProtocolTypeArg` scans `param_impl_map`). In type position `xs.T` parses as a dotted `type_expr`, so packTypeElems splits on '.'. examples/199-pack-type-projection.sx. This completes 2.3's core: all spread/projection forms — call-arg, tuple value, tuple type, closure sig — now lower. The canonical's `Closure(..sources.T)` / `mapper(..sources.value)` / `(..sources)` shapes are functional.
This commit is contained in:
1
tests/expected/199-pack-type-projection.exit
Normal file
1
tests/expected/199-pack-type-projection.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
tests/expected/199-pack-type-projection.txt
Normal file
2
tests/expected/199-pack-type-projection.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
0=42 1=hi
|
||||
fold=20
|
||||
Reference in New Issue
Block a user