Generic call unification #18
Reference in New Issue
Block a user
Delete Branch "feat/unification"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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