[GHC] #14365: Panic with (bogus?) deriving in hs-boot: newTyConEtadArity
#14365: Panic with (bogus?) deriving in hs-boot: newTyConEtadArity -------------------------------------+------------------------------------- Reporter: happykitten | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 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: -------------------------------------+------------------------------------- {{{ $ cat A.hs module Main where import {-# SOURCE #-} B main = return () $ cat B.hs module B where data Foo a = Foo a deriving (Functor) $ cat B.hs-boot module B where data Foo a deriving (Functor) $ ghc --make A.hs [1 of 3] Compiling B[boot] ( B.hs-boot, B.o-boot ) ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for i386-unknown-linux): newTyConEtadArity Foo Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1133:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1137:37 in ghc:Outputable pprPanic, called at compiler/types/TyCon.hs:2149:27 in ghc:TyCon Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14365> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14365: Panic with (bogus?) deriving in hs-boot: newTyConEtadArity -------------------------------------+------------------------------------- Reporter: happykitten | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4102 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * keywords: => deriving * differential: => Phab:D4102 Comment: Well that's embarrassing. The [http://git.haskell.org/ghc.git/blob/317aa966b3d89e45227a5870feba339e34d77a18... GHC users' guide] states that you can't have derived instances in `.hs- boot` files, but clearly we weren't checking for this in practice. Phab:D4102 is an attempt to do so. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14365#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14365: Panic with (bogus?) deriving in hs-boot: newTyConEtadArity -------------------------------------+------------------------------------- Reporter: happykitten | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: deriving Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4102 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"101a8c770b9d3abd57ff289bffea3d838cf25c80/ghc" 101a8c7/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="101a8c770b9d3abd57ff289bffea3d838cf25c80" Error when deriving instances in hs-boot files Summary: According to the GHC users' guide, one cannot derive instances for data types in `.hs-boot` files. However, GHC was not enforcing this in practice, which led to #14365. Fix this by actually throwing an error if a derived instance is detected in an `.hs-boot` file (and recommend how to fix it in the error message.) Test Plan: make test TEST=T14365 Reviewers: ezyang, austin, bgamari, simonpj Reviewed By: simonpj Subscribers: simonpj, rwbarton, thomie GHC Trac Issues: #14365 Differential Revision: https://phabricator.haskell.org/D4102 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14365#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14365: Panic with (bogus?) deriving in hs-boot: newTyConEtadArity -------------------------------------+------------------------------------- Reporter: happykitten | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: deriving Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | deriving/should_fail/T14365 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4102 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => deriving/should_fail/T14365 * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14365#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC