Improve inference of polymorphic types #392
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
In the below example the assignment of
xis failing even though the user would expect this to pass, regardless of the type ofDT_CO_TWICE(f_c_to_u_to_a)(it should pass whether the type isdt_co_twice(Animal)ordt_co_twice(Cat)becausedt_co_twicein covariant in'a).The error originates from the rvalue in the assignment of
x. When matching between(Cat => unit) => Animal)(the type off_c_to_u_to_a) and('a => unit) => 'a(the type in the type constructorDT_CO_TWICE), the type variable'ais first bound toCat, and when it tries to bind toAnimalit fails.