Note [Unquantified tyvars in a pattern synonym]
Consider (#21479) data T a where MkT :: Int -> T Char -- A GADT foo :: forall b. Bool -> T b -- Somewhat strange type pattern T1 <- (foo -> MkT) In the view pattern, foo is instantiated, let's say b :-> b0 where b0 is a unification variable. Then matching the GADT MkT will add the "provided" constraint b0~Char, so we might infer pattern T1 :: () => (b0~Char) => Int -> Bool Nothing constrains that `b0`. We don't want to quantify over it. We don't want to to zonk to Any (we don't like Any showing up in user-visible types). So we want to error here. See Note [Error on unconstrained meta-variables] in GHC.Tc.Utils.TcMType Hence the call to doNotQuantifyTyVars here.
References 1
- Error on unconstrained meta-variables GHC.Tc.Utils.TcMType
Referenced by 1
- GHC.Tc.TyCl.PatSyn call site