[GHC] #10285: Bug in Coerciible
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: Type: bug | Status: new Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Blocked By: Test Case: | Related Tickets: Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Richard and I uncovered this {{{ {-# LANGUAGE RoleAnnotations #-} module Bar( N ) where -- Data constructor not exported type role N representational newtype N a = MkN Int }}} and {{{ {-# LANGUAGE FlexibleContexts #-} module Foo where import Data.Coerce import Data.Type.Coercion import Bar f :: Coercible (N a) (N b) => Coercion a b f = Coercion }}} This compiles but it should not! It wrongly compiles by using `nth (N a ~R N b)`; but (as Fig 4 of [http://research.microsoft.com/en- us/um/people/simonpj/papers/ext-f/ the Corcible paper] says), we can't decompose a newtype at representational role. Easy to fix. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by simonpj): * owner: => goldfire -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by simonpj): Also add a check in Lint -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: goldfire Type: bug | Status: new Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Richard Eisenberg <eir@…>): In [changeset:"a8d39a7255df187b742fecc049f0de6528b9acad/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="a8d39a7255df187b742fecc049f0de6528b9acad" Fix #10285 by refusing to use NthCo on a newtype. During this commit, I tested to make sure that CoreLint actually catches the Core error if the typechecker doesn't. Test case: typecheck/should_fail/T10285 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: goldfire Type: bug | Status: merge Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | typecheck/should_fail/T10285 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by goldfire): * status: new => merge * testcase: => typecheck/should_fail/T10285 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#10285: Bug in Coerciible -------------------------------------+------------------------------------- Reporter: simonpj | Owner: goldfire Type: bug | Status: closed Priority: highest | Milestone: 7.10.2 Component: Compiler | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | typecheck/should_fail/T10285 | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-7.10`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10285#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC