Skip to content

Fix #22425 - Broken eta-expansion over expensive work. 9.2 backport

Andreas Klebinger requested to merge wip/andreask/92-dlist into ghc-9.2
 This is the 9.2 backport of !9357

Through a mistake in the latest backport we started eta-expanding over
expensive work by mistake. E.g. over <expensive> in code like:

  case x of
    A -> id
    B -> <expensive>

We fix this by only eta-expanding over <expensive> if all other branches
are headed by an oneShot lambda.

In the long story of broken eta-expansion on 9.2/9.4 this is hopefully
the last chapter.

Merge request reports