We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c557e66 commit e087036Copy full SHA for e087036
clash-lib/src/Clash/Normalize/Transformations.hs
@@ -459,7 +459,10 @@ caseCon (TransformContext is0 _) (Case scrut ty alts)
459
in case Maybe.catMaybes binds2 of
460
[] -> body
461
binds3 -> Letrec binds3 body
462
- let subst = extendTvSubstList (mkSubst is1)
+ -- Use the original inScopeSet 'is0' here, not the extended inScopeSet
463
+ -- 'is1', otherwise we'd make the "caseCon1" substitution substitute
464
+ -- free variables that were shadowed by the pattern!
465
+ let subst = extendTvSubstList (mkSubst is0)
466
$ zip tvs (drop (length (dcUnivTyVars dc)) (Either.rights args))
467
changed (substTm "caseCon1" subst e')
468
_ -> case alts of
0 commit comments