Skip to content

Fix #15344: use fail when desugaring applicative-do

Josef Svenningsson requested to merge josefs/ghc:ado into master

Applicative-do has a bug where it fails to use the monadic fail method when desugaring patternmatches which can fail. See #15344 (closed).

This patch fixes that problem. It required more rewiring than I had expected. Applicative-do happens mostly in the renamer; that's where decisions about scheduling are made. This schedule is then carried through the typechecker and into the desugarer which performs the actual translation. Fixing this bug required sending information about the fail method from the renamer, through the type checker and into the desugarer. Previously, the desugarer didn't have enough information to actually desugar pattern matches correctly.

Merge request reports