Skip to content

Fix INLINE pragmas in desugarer (fixes #19969)

Simon Peyton Jones requested to merge wip/T19873 into master

In #19873 we discovered that GHC has has a bug forever that means it sometimes essentially discarded INLINE pragams. This happened when you have

  • Two more more mutually recursive functions
  • Some of which (presumably not all!) have an INLINE pragma
  • Completely monomorphic.

This hits a particular case in GHC.HsToCore.Binds.dsAbsBinds, which was simply wrong -- it put the INLINE pragma on the wrong binder.

This patch fixes the bug, rather easily, by adjusting the no-tyvar, no-dict case of GHC.HsToCore.Binds.dsAbsBinds.

Edited by Sylvain Henry

Merge request reports