[GHC] #16195: Program with trivial polymorphism leads to out of scope dictionary

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Keywords: | Operating System: Unknown/Multiple TypedTemplateHaskell | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Almost certainly due to c2455e647501c5a382861196b64df3dd05b620a2 A trivial program now causes a core lint error due to an out-of-scope dictionary. {{{ module A where foo :: Code (IO ()) foo = [|| return () ||] }}} {{{ module B where main :: IO () main = $$foo }}} {{{ *** Core Lint errors : in result of Desugar (before optimization) *** <no location info>: warning: In the expression: return @ IO $dMonad_a4od @ () () Out of scope: $dMonad_a4od :: Monad m_a4oc[tau:0] [LclId] *** Offending Program *** Rec { $trModule :: Module [LclIdX] $trModule = Module (TrNameS "main"#) (TrNameS "B"#) main :: IO () [LclIdX] main = return @ IO $dMonad_a4od @ () () end Rec } *** End of Offense *** }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: new Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: | Keywords: | TypedTemplateHaskell 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 mpickering): I tried adding a call to `captureTopConstraints` around the `zonkTcGblEnv` where the splices are run but it doesn't seem to capture any evidence. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: patch Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: | Keywords: | TypedTemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by mpickering): * status: new => patch Comment: MR: https://gitlab.haskell.org/ghc/ghc/merge_requests/131 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: | Keywords: | TypedTemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * status: patch => merge Comment: I understand we'd like to merge this, since the commit causing the regression is in ghc-8.8. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: | Keywords: | TypedTemplateHaskell 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): Do we have a regression test? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary -------------------------------------+------------------------------------- Reporter: mpickering | Owner: (none) Type: bug | Status: merge Priority: high | Milestone: 8.8.1 Component: Compiler | Version: 8.7 Resolution: | Keywords: | TypedTemplateHaskell Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T16195 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by monoidal): * testcase: => th/T16195 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16195#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16195: Program with trivial polymorphism leads to out of scope dictionary
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner: (none)
Type: bug | Status: merge
Priority: high | Milestone: 8.8.1
Component: Compiler | Version: 8.7
Resolution: | Keywords:
| TypedTemplateHaskell
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case: th/T16195
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Marge Bot
participants (1)
-
GHC