Genericize unifier implementation to remove all special case handling for lists and ndarrays #444

Open
opened 2024-07-04 15:26:36 +08:00 by derppening · 0 comments
Collaborator

The unifier currently has several locations where there are special case handling for lists and ndarrays, including:

  • get_instantiations, get_subst, subst_map - If we are instantiating a bounded type variable, we currently must use the TypeVarId of the type variable rather than allowing the use of the TypeVarId of the class type parameter.
  • get_intersection - The intersection for TObj types are currently too lax, causing class types with different type variables to be treated as an intersection result. Moreover, handling for TLiteral is currently missing, causing ndarray typechecks to fail.
The unifier currently has several locations where there are special case handling for lists and ndarrays, including: - `get_instantiations`, `get_subst`, `subst_map` - If we are instantiating a bounded type variable, we currently must use the `TypeVarId` of the type variable rather than allowing the use of the `TypeVarId` of the class type parameter. - `get_intersection` - The intersection for `TObj` types are currently too lax, causing class types with different type variables to be treated as an intersection result. Moreover, handling for `TLiteral` is currently missing, causing `ndarray` typechecks to fail.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/nac3#444
No description provided.