
#14118: Strangeness regarding STG alternative types and linter -------------------------------------+------------------------------------- Reporter: bgamari | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D3858 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Judging from the logic in `lintStgExpr` mention in the ticket description, it seems like GHC is supposed to maintain the invariant that we will not use the case binder in the RHS if it is an unboxed tuple or sum (e.g. a `MultiValAlt`). However, I can't find this invariant documented anywhere, nor do we seem to respect it. For instance, consider this example from compiling `TyCoRep`, {{{ ghc-stage1: panic! (the 'impossible' happened) (GHC version 8.3.20170824 for x86_64-unknown-linux): *** Stg Lint ErrMsgs: in Stg2Stg *** <no location info>: warning: [in body of lambda with binders w_sx0k :: Coercion, w69_sx0l :: InterestingVarFun, w70_sx0m :: VarSet, ww_sx0n :: [Var], ww1_sx0o :: VarSet] ww5_sx1u :: (# [Var], VarSet #) is out of scope }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14118#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler