Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 5, 2026

Summary

  • Fix type mismatch when named definitions returning structured types (enums, structs) are used without capture inside named nodes
  • Add new diagnostics for ambiguous cases: AmbiguousUncapturedOutputs and UncapturedOutputWithCaptures
  • Extract compute_merged_flow helper to deduplicate logic between infer_named_node and infer_seq_expr
  • Fix typegen to emit entrypoints with array result types

Why

When extracting a pattern into a named definition and referencing it, the behavior should be preserved. Previously:

Q = (program [X: (x) Y: (y)])  ; produces enum

But after extraction:

A = [X: (x) Y: (y)]
Q = (program (A))              ; produced void (bug!)

Now both produce the enum type correctly. Arrays also propagate: (program (A)+) produces A[].

Notes

  • "Scalar" terminology replaced with "output" for clarity (scalars typically mean primitives, but we're dealing with structured types)
  • Errors are intentionally strict to help LLMs self-correct rather than silently fail

@zharinov zharinov merged commit 3e1522a into master Jan 5, 2026
4 checks passed
@zharinov zharinov deleted the fix/output-propagation branch January 5, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants