as in the comment, we might need to do something like consider the 'overall' type of the whole declaration so that we include all of the meta var names for each of the type bits instead of just considering the small bit of the overall dec type itself. (yes i know decs don't have types but i'm using "dec type" as a shorthand for "type of the top level pattern/exp of the val bind in the val dec".)
we may also want to use this 'overall' type anyway so we get the type scheme, which gives us proper bound type variables like 'a instead of meta type variables like ?a.
Environment
Steps to reproduce
something like these:
Expected behavior
types are reported correctly in e.g. inlay hints or hover for ty
Actual behavior
types are reported incorrectly sometimes: compare the hover type (correct) vs inlay hints (wrong)
also see this test for swap
Fix
as in the comment, we might need to do something like consider the 'overall' type of the whole declaration so that we include all of the meta var names for each of the type bits instead of just considering the small bit of the overall dec type itself. (yes i know decs don't have types but i'm using "dec type" as a shorthand for "type of the top level pattern/exp of the val bind in the val dec".)
we may also want to use this 'overall' type anyway so we get the type scheme, which gives us proper bound type variables like
'a
instead of meta type variables like?a
.