[GHC] #12945: Backpack signature matching doesn't pick up orphan instances
#12945: Backpack signature matching doesn't pick up orphan instances -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler | Version: 8.1 (Type checker) | Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Repro: {{{ unit impl where module A where data T = T module B(module A, module B) where import A instance Show T where show T = "T" unit sig where signature B where data T = T instance Show T module App where import B app = print T unit main where dependency sig[B=impl:B] module Main where import App main = app }}} I get: {{{ ezyang@sabre:~$ ghc-head --backpack foo.bkp [1 of 3] Processing impl Instantiating impl [1 of 2] Compiling A (.hs -> .o) [2 of 2] Compiling B (.hs -> .o) [2 of 3] Processing sig [3 of 3] Processing main Instantiating main [1 of 1] Including sig[B=impl:B] Instantiating sig[B=impl:B] [1 of 2] Compiling B[sig] (.hsig -> .o) sig/sig-HVnmSw44WZeBfwnUur4wzl/../B.hi:1:1: error: No instance for (GHC.Show.Show impl:A.T) arising when attempting to show that instance [safe] GHC.Show.Show impl:A.T -- Defined in ‘impl:B’ is provided by ‘impl:B’ }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12945> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12945: Backpack signature matching doesn't pick up orphan instances -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: high | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: | Keywords: backpack 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 Edward Z. Yang <ezyang@…>): In [changeset:"62332f36b62431ddb9ab3c97365288c7d3fc2d39/ghc" 62332f3/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="62332f36b62431ddb9ab3c97365288c7d3fc2d39" Setup tcg_imports earlier during signature matching, so orphans are visible. Summary: Previously, we updated tcg_imports after doing all of the actual matching, which was fine for outputting the interface, but not good enough for checking if all type classes were implemented; we weren't treating orphans as visible (when they needed to be.) Fixes #12945. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2802 GHC Trac Issues: #12945 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12945#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12945: Backpack signature matching doesn't pick up orphan instances -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: high | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: fixed | Keywords: backpack 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 ezyang): * status: new => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12945#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC