
#13242: Panic "StgCmmEnv: variable not found" with ApplicativeDo and ExistentialQuantification -------------------------------------+------------------------------------- Reporter: ljli | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 8.0.3 Component: Compiler | Version: 8.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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): Simon, I also want to discuss the implementation. Look at `goArgs` in `tcApplicativeStmts`. It uses a CPS structure, so that things brought into scope stay in scope. But that's wrong for constraints (hence this ticket), and it's not really right for bindings either (only the `thing_inside` needs to see those binders). So, proposal: * Use a `mapM` to process each of the args indepdendly (mirroring the intended parallel semantics) * Now bring into scope all the variables bound by the args (which we can get from their patterns), and typecheck `thing_inside`. Can you see anything wrong with this? Should not be hard to try. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13242#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler