foundation test core lint failure (ghci-opt way and breakpoints)
_perf/stage1/bin/ghc --interactive -fno-unoptimized-core-for-interpreter -O testsuite/tests/numeric/should_run/foundation.hs -dcore-lint
leads to failure
GHCi, version 9.13.20250125: https://www.haskell.org/ghc/ :? for help
[1 of 2] Compiling Main ( testsuite/tests/numeric/should_run/foundation.hs, interpreted )
*** Core Lint errors : in result of Worker Wrapper binds ***
testsuite/tests/numeric/should_run/foundation.hs:172:16: warning:
The value variable ‘ds_d3Pp’ is out of scope
In the RHS of lvl_s5zE :: RunS -> RunS
In the unfolding of lvl_s5zE :: RunS -> RunS
In the body of lambda with binder s_a1E3 :: RunS
In an occurrence of ds_d3Pp :: Int
Substitution: <InScope = {}
IdSubst = []
TvSubst = []
CvSubst = []>
lvl_s5zE [Dmd=LC(S,L)] :: RunS -> RunS
[LclId,
Arity=1,
Str=<S!P(L,L)>,
Cpr=1,
Unf=Unf{Src=StableSystem, TopLvl=True,
Value=True, ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False)
Tmpl= \ (s_a1E3 [Dmd=S!P(L,L)] :: RunS) ->
break<Main,2>(s_a1E3)
RunS
(break<Main,1>(s_a1E3)
case break<Main,0>(s_a1E3) break<Main,273>(ds_d3Pp) ds_d3Pp of
{ I# x_a4jE [Occ=Once1] ->
I# (+# x_a4jE 1#)
})
rg_B2}]
lvl_s5zE
= \ (s_a1E3 [Dmd=S!P(L,L)] :: RunS) ->
break<Main,2>(s_a1E3)
case s_a1E3 of { RunS ds_d3Pp [Dmd=L!P(L)] rg_B2 ->
RunS
(break<Main,1>(s_a1E3)
case break<Main,0>(s_a1E3) break<Main,273>(ds_d3Pp) ds_d3Pp of
{ I# x_a4jE ->
I# (+# x_a4jE 1#)
})
rg_B2
}
It is something to do with optimisation and breakpoints interacting in a poor manner.