[GHC] #8522: exprType incorrect for let expressions which bind types
#8522: exprType incorrect for let expressions which bind types ------------------------------------+------------------------------------- Reporter: afarmer | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ------------------------------------+------------------------------------- The `exprType` function in CoreUtils doesn't handle let expressions which bind type variables correctly. Consider: {{{ let a = Int in \ $dNum x y -> (+) a $dNum x y }}} `exprType` on this expression will give: `Num a => a -> a -> a` instead of `Num Int => Int -> Int -> Int` Obviously the core lint checker does the right thing, so I modified exprType (see attached patch) to do what it does. I'm guessing that exprType isn't used in any crucial capacity (or let-bound types are not that common) or the fact that `a` is unbound in the result would be a big problem. That said, we use this function heavily in HERMIT... is there another we should be using instead? Any chance this can make the 7.8 window? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8522> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8522: exprType incorrect for let expressions which bind types -------------------------------------+------------------------------------ Reporter: afarmer | Owner: Type: bug | Status: patch Priority: high | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by afarmer): * status: new => patch -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8522#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8522: exprType incorrect for let expressions which bind types -------------------------------------+------------------------------------ Reporter: afarmer | Owner: Type: bug | Status: patch Priority: high | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"96e6eddc40c34a171f6261a7814a1e264457ce86/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="96e6eddc40c34a171f6261a7814a1e264457ce86" Make exprType work correctly in the presnce of type bindings (Trac #8522) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8522#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8522: exprType incorrect for let expressions which bind types -------------------------------------+------------------------------------ Reporter: afarmer | Owner: Type: bug | Status: patch Priority: high | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Comment (by simonpj): OK done. I'd implemented it slightly differently -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8522#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8522: exprType incorrect for let expressions which bind types -------------------------------------+------------------------------------ Reporter: afarmer | Owner: Type: bug | Status: closed Priority: high | Milestone: Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------ Changes (by simonpj): * status: patch => closed * resolution: => fixed Comment: It's not easy to make a test case, so closing. Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8522#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC