Commit 88b68350 authored by fendor's avatar fendor

Add `isInScope` check to `lintCoercion`

Mirrors the behaviour of `lintType`.
parent 568d7279
......@@ -1794,7 +1794,12 @@ lintCoercion (CoVarCo cv)
= do { subst <- getTCvSubst
; case lookupCoVar subst cv of
Just linted_co -> return linted_co ;
Nothing -> -- lintCoBndr always extends the substitition
Nothing
| cv `isInScope` subst
-> return (CoVarCo cv)
| otherwise
->
-- lintCoBndr always extends the substitition
failWithL $
hang (text "The coercion variable" <+> pprBndr LetBind cv)
2 (text "is out of scope")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment