[GHC] #11148: T9563 doesn't pass with reversed uniques
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- It fails with {{{ T9563.hs:18:1: error: • Can't make a derived instance of ‘Generic1 (G Int b Float)’: No family instance for ‘G Int b Float’ • In the stand-alone deriving instance for ‘Generic1 (G Int b Float)’ }}} Steps to reproduce: 1. Change line `TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS)` to `TEST_HC_OPTS = -dinitial-unique=16777206 -dunique-increment=-1 -fforce- recomp -dcore-lint -dcmm-lint -dno-debug-output -no- user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS)` in `mk/test.mk` 2. `make TESTS=T9563` -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 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: | -------------------------------------+------------------------------------- Changes (by niteria): * cc: simonmar, simonpj (added) -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 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: | -------------------------------------+------------------------------------- Changes (by simonpj): * cc: kosmikus, RyanGlScott (added) Comment: Andres, Ryan: any ideas? This is in the `Generics` area. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 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 RyanGlScott): I'm not immediately sure what's wrong, but it doesn't seem specific to `Generic1`. In fact, you can get the same error if you change `Generic1` to `Functor`, `Foldable`, or `Traversable`. It seems that something about typeclasses with kind `(* -> *) -> Constraint` triggers this, since I can derive `Eq`, `Ord`, `Read`, `Show`, `Data`, and `Lift` for `G Int b Float d` without any issue. Another clue is that `data instance F A a = AData a deriving Generic1` works fine, but `data instance F b a = AData a deriving Generic1` triggers this error, so you need at least one type variable in a data instance for this to happen. Perhaps the type variable in the data family declaration and the type variable in the data family instance have conflicting `Unique`s when reversed? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 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 Simon Peyton Jones <simonpj@…>): In [changeset:"1160dc516f8b27249d819665883409ee270a743f/ghc" 1160dc5/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1160dc516f8b27249d819665883409ee270a743f" Fix egregious error in eta-reduction of data families This terrible and long-standing bug was shown up by Trac #11148. We are trying to eta-reduce a data family instance, so that we can then derive Functor or Generic. But we were assuming, for absolutely not reason whatsoever, that the type variables were lined up in a convenient order. The fact that it ever worked was a fluke. This patch fixes it properly. Main change is in eta_reduce in TcInstDcls.tcDataFamInstDecl }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_compile/T11148 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => deriving/should_compile/T11148 * resolution: => fixed Comment: Fixed, with a test case (using Functor) added. Thank you for identifying this bug! Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_compile/T11148 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"e2f7d777bb7e4c176e01e1c4f8184f115253dee0/ghc" e2f7d777/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="e2f7d777bb7e4c176e01e1c4f8184f115253dee0" A tiny, outright bug in tcDataFamInstDecl This bug was revealed by Trac #11362. It turns out that in my patch for Trac #11148 (namely 1160dc5), I failed to turn one occurrence of tvs' into full_tvs. Sigh. This is tricky stuff and it cost me several hours to page it back in and figure out what was happening. The result was a CoAxiom whose lhs had rhs had different kinds. Eeek! Anyway it's fixed. I also added an ASSERT, in FamInst.newFamInst, that trips on such bogus CoAxioms. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_compile/T11148 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: closed => merge Comment: Merged tiny, outright bug fix to `ghc-8.0` as a885f485d3a017658a29b7436f875e7d457b0c81. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11148: T9563 doesn't pass with reversed uniques -------------------------------------+------------------------------------- Reporter: niteria | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_compile/T11148 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11148#comment:9> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC