WorkWrap: Handle partial FUN apps in `isRecDataCon` (#21265)
Partial FUN apps like `(->) Bool` aren't detected by `splitFunTy_maybe`. A silly oversight that is easily fixed by replacing `splitFunTy_maybe` with a guard in the `splitTyConApp_maybe` case. But fortunately, Simon nudged me into rewriting the whole `isRecDataCon` function in a way that makes it much shorter and hence clearer which DataCons are actually considered as recursive. Fixes #21265.
Showing
- compiler/GHC/Core/Opt/CprAnal.hs 29 additions, 26 deletionscompiler/GHC/Core/Opt/CprAnal.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs 45 additions, 67 deletionscompiler/GHC/Core/Opt/WorkWrap/Utils.hs
- testsuite/tests/stranal/should_compile/T21265.hs 15 additions, 0 deletionstestsuite/tests/stranal/should_compile/T21265.hs
- testsuite/tests/stranal/should_compile/all.T 1 addition, 0 deletionstestsuite/tests/stranal/should_compile/all.T
Loading
Please register or sign in to comment