Skip to content

docs: design for interface values - #1405

Open
kacy wants to merge 1 commit into
mainfrom
docs-interface-values
Open

kacy wants to merge 1 commit into
mainfrom
docs-interface-values

Conversation

@kacy

@kacy kacy commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Design for interface values: an interface name usable as a value type (List[Shape] of mixed types), dispatched at run time.

  • Representation: an ordinary counted struct handle holding a type id, the concrete value and one function pointer per method, so collections, results and the count checker carry it unchanged.
  • One new IR instruction, calli (plus rcalli), lowered like a closure call.
  • E316 for interfaces that cannot be values (generic methods, Self, associated types).
  • Downcasts, embedding and value equality are left for later.

Nothing is implemented yet; the plan section lists the order.

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.

1 participant