[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

#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
participants (1)
-
GHC