[GHC] #14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity]
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: Compile-time Unknown/Multiple | crash or panic Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- In GHC 8.2.1 and HEAD, compiling this file panics: {{{#!hs import Data.Type.Equality instance (~~) Int Int }}} {{{ $ /opt/ghc/8.2.1/bin/ghc Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Bug.hs:2:10: error:ghc: panic! (the 'impossible' happened) (GHC version 8.2.1 for x86_64-unknown-linux): ppr_equality: homogeneity ~~ 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/iface/IfaceType.hs:1008:31 in ghc:IfaceType }}} We should probably give a similar error as for when one attempts to define an instance for `(~)`: {{{#!hs instance (~) Int Int }}} {{{ $ /opt/ghc/8.2.1/bin/ghc Bug.hs [1 of 1] Compiling Main ( Bug.hs, Bug.o ) Bug.hs:1:10: error: • Illegal instance declaration for ‘Int ~ Int’ Manual instances of this class are not permitted. • In the instance declaration for ‘(~) Int Int’ | 1 | instance (~) Int Int | ^^^^^^^^^^^ }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj):
We should probably give a similar error as for when one attempts to define an instance for (~):
Yes please! -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4132 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D4132 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4132 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"85aa1f4253163985fe07d172f8da73b784bb7b4b/ghc" 85aa1f42/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="85aa1f4253163985fe07d172f8da73b784bb7b4b" Fix #14390 by making toIfaceTyCon aware of equality GHC was panicking when pretty-printing a heterogeneous equality type constructor (#14390) because the function which produced the type constructor, `toIfaceTyCon`, wasn't attaching the appropriate `IfaceTyConSort` for equality type constructors, which is `IfaceEqualityTyCon`. This is fixed easily enough. Test Plan: make test TEST=T14390 Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #14390 Differential Revision: https://phabricator.haskell.org/D4132 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4132 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed * milestone: => 8.4.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: T14390 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4132 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * testcase: => T14390 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#14390: Panic when defining an instance for (~~) [ppr_equality: homogeneity] -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.4.1 Component: Compiler | Version: 8.2.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Compile-time | Unknown/Multiple crash or panic | Test Case: T14390 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D4132 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"29ae83374647e227d76acd896b89590fc15590d6/ghc" 29ae833/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="29ae83374647e227d76acd896b89590fc15590d6" Tidy up IfaceEqualityTyCon This commit commit 85aa1f4253163985fe07d172f8da73b784bb7b4b Date: Sun Oct 29 20:48:19 2017 -0400 Fix #14390 by making toIfaceTyCon aware of equality was a bit over-complicated. This patch simplifies the (horribly ad-hoc) treatement of IfaceEqualityTyCon, and documents it better. No visible change in behaviour. }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14390#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC