Change mtv_info to a set of MetaInfo
Currently, metavariables can have only one MetaInfo
:
data TcTyVarDetails
= SkolemTv {..}
| RuntimeUnk
| MetaTv { mtv_info :: MetaInfo
, mtv_ref :: IORef MetaDetails
, mtv_tclvl :: TcLevel }
data MetaInfo
= TauTv
| TyVarTv
| RuntimeUnkTv
| CycleBreakerTv
| ConcreteTv ConcreteTvOrigin
This assumes that the concerns are orthogonal, for example that we never want a TyVarTv
that is also a CycleBreakerTv
, nor a ConcreteTv
that is also a TyVarTv
.
I don't know of any bugs in the compiler due to this design (which is why I marked this ticket as having low priority), but I think the design should instead be:
data TcTyVarDetails
= ..
| MetaTv { mtv_infos :: [MetaInfo], .. }
data MetaInfo
= TyVarTv
| RuntimeUnkTv
| CycleBreakerTv
| ConcreteTv ConcreteTvOrigin
That is, store a [MetaInfo]
in MetaTv
, and remove the TauTv
constructor of MetaInfo
(it corresponds to a plain metavariable, i.e. mtv_infos = []
).