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

Add a missing tidy in UnivCo

We were failing to tidy the argument coercions of a UnivCo, which
led directly to #25391.

The fix is, happily, trivial.

I don't have a small repro case (it came up when building horde-ad,
which uses typechecker plugins).  It should be possible to make a
repro case, by using a plugin (which builds a UnivCo) but I decided
it was not worth the bother. The bug is egregious and easily fixed.
parent 301c3b54
No related branches found
No related tags found
No related merge requests found
......@@ -336,16 +336,18 @@ tidyCo env co
go (AppCo co1 co2) = (AppCo $! go co1) $! go co2
go (ForAllCo tv visL visR h co)
= ((((ForAllCo $! tvp) $! visL) $! visR) $! (go h)) $! (tidyCo envp co)
where (envp, tvp) = tidyVarBndr env tv
where (envp, tvp) = tidyVarBndr env tv
-- the case above duplicates a bit of work in tidying h and the kind
-- of tv. But the alternative is to use coercionKind, which seems worse.
go (FunCo r afl afr w co1 co2) = ((FunCo r afl afr $! go w) $! go co1) $! go co2
go (CoVarCo cv) = CoVarCo $! go_cv cv
go (HoleCo h) = HoleCo $! go_hole h
go (AxiomCo ax cos) = AxiomCo ax $ strictMap go cos
go co@(UnivCo { uco_lty = t1, uco_rty = t2 })
= co { uco_lty = tidyType env t1, uco_rty = tidyType env t2 }
-- Don't bother to tidy the uco_deps field
go (UnivCo prov role t1 t2 cos)
= ((UnivCo prov role
$! tidyType env t1)
$! tidyType env t2)
$! strictMap go cos
go (SymCo co) = SymCo $! go co
go (TransCo co1 co2) = (TransCo $! go co1) $! go co2
go (SelCo d co) = SelCo d $! go co
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment