Note [Linting of runRW#]
runRW# has some very special behavior (see Note [runRW magic] in GHC.CoreToStg.Prep) which CoreLint must accommodate, by allowing join points in its argument. For example, this is fine: join j x = ... in runRW# (\s. case v of A -> j 3 B -> j 4) Usually those calls to the join point 'j' would not be valid tail calls, because they occur in a function argument. But in the case of runRW# they are fine, because runRW# (\s.e) behaves operationally just like e. (runRW# is ultimately inlined in GHC.CoreToStg.Prep.) In the case that the continuation is /not/ a lambda we simply disable this special behaviour. For example, this is /not/ fine: join j = ... in runRW# @r @ty (jump j)
References 1
- runRW magic GHC.CoreToStg.Prep
Referenced by 5
- GHC.CoreToStg.Prep call site ×2
- GHC.Core.Lint call site
- Simplification of runRW# GHC.CoreToStg.Prep
- magicIds GHC.Types.Id.Make