Generic call unification #18

Merged
HEL merged 4 commits from feat/unification into main 2026-06-21 11:41:48 +00:00
Owner

This PR adds a simple Unifier class to match call arguments against a generic signature and try to resolve type parameter substitutions.
The unification process is currently quite strict, checking type equality when a type variable is used in multiple places.
A different approach could be to automatically widen the type if possible.
The unifier doesn't support passing unapplied generic types as arguments yet.
This could be implement by generalized the substitutions merging process to handle subtype constraints, but it might be overkill for the scope of this project

This PR adds a simple Unifier class to match call arguments against a generic signature and try to resolve type parameter substitutions. The unification process is currently quite strict, checking type _equality_ when a type variable is used in multiple places. A different approach could be to automatically widen the type if possible. The unifier doesn't support passing unapplied generic types as arguments yet. This could be implement by generalized the substitutions merging process to handle subtype constraints, but it might be overkill for the scope of this project
HEL self-assigned this 2026-06-21 11:41:42 +00:00
HEL added 4 commits 2026-06-21 11:41:43 +00:00
HEL merged commit 739871c101 into main 2026-06-21 11:41:48 +00:00
HEL deleted branch feat/unification 2026-06-21 11:41:48 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: HEL/midas#18