Skip to content
Snippets Groups Projects
Commit 7641a74a authored by Simon Peyton Jones's avatar Simon Peyton Jones Committed by Marge Bot
Browse files

Get a decent MatchContext for pattern synonym bindings

In particular when we have a pattern binding
    K p1 .. pn = rhs
where K is a pattern synonym.  (It might be nested.)

This small MR fixes #25995.  It's a tiny fix, to an error message,
removing an always-dubious `unkSkol`.

The bug report was in the context of horde-ad, a big program,
and I didn't manage to make a small repro case quickly. I decided
not to bother further.
parent 217caad1
Branches
No related tags found
No related merge requests found
......@@ -1265,9 +1265,10 @@ tcPatSynPat (L con_span con_name) pat_syn pat_ty penv arg_pats thing_inside
; let all_arg_tys = ty : prov_theta ++ (map scaledThing arg_tys)
; checkGADT (PatSynCon pat_syn) ex_tvs all_arg_tys penv
; skol_info <- case pe_ctxt penv of
LamPat mc -> mkSkolemInfo (PatSkol (PatSynCon pat_syn) mc)
LetPat {} -> return unkSkol -- Doesn't matter
; let match_ctxt = case pe_ctxt penv of
LamPat mc -> mc
LetPat {} -> PatBindRhs
; skol_info <- mkSkolemInfo (PatSkol (PatSynCon pat_syn) match_ctxt)
; (tenv, ex_tvs') <- tcInstSuperSkolTyVarsX skol_info subst ex_tvs
-- This freshens: Note [Freshen existentials]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment