[GHC] #14735: GHC Panic with QuantifiedConstraints

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple QuantifiedContexts | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- From branch [https://ghc.haskell.org/trac/ghc/ticket/2893#comment:28 wip/T2893] {{{#!hs {-# Language QuantifiedConstraints #-} {-# Language StandaloneDeriving #-} {-# Language DataKinds #-} {-# Language TypeOperators #-} {-# Language GADTs #-} {-# Language KindSignatures #-} {-# Language FlexibleInstances #-} {-# Language UndecidableInstances #-} {-# Language MultiParamTypeClasses #-} {-# Language RankNTypes #-} {-# Language ConstraintKinds #-} import Data.Kind data D c where D :: c => D c newtype a :- b = S (a => D b) class C1 a b class C2 a b instance C1 a b => C2 a b class (forall xx. f xx) => Limit f instance (forall xx. f xx) => Limit f -- impl :: Limit (C1 a) :- Limit (C2 a) -- impl = S D infixr 5 :< data Sig a = N a | a :< Sig a data AST :: (Sig Type -> Type) -> (Sig Type -> Type) where Sym :: dom a -> AST dom a (:$) :: AST dom (xx :< a) -> AST dom (N xx) -> AST dom a deriving instance (forall xx. Show (dom xx)) => Show (AST dom a) data Arith a where Plus :: Arith (Int :< Int :< N Int) deriving instance Show (Arith a) }}} loading this program and evaluating `Sym Plus` works fine: {{{ $ ghc-stage2 --interactive hs/175-bug.hs GHCi, version 8.5.20180128: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( hs/175-bug.hs, interpreted ) Ok, one module loaded. *Main> Sym Plus Sym Plus *Main> }}} but we uncomment `impl` we get a panic! {{{ GHCi, version 8.5.20180128: http://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( hs/175-bug.hs, interpreted ) Ok, one module loaded. *Main> Sym Plus ghc-stage2: panic! (the 'impossible' happened) (GHC version 8.5.20180128 for x86_64-unknown-linux): nameModule system df_a2VB Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable pprPanic, called at compiler/basicTypes/Name.hs:241:3 in ghc:Name Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug *Main> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | QuantifiedContexts 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): Perhaps this is just me, but I think that it's pretty early to be submitting bug reports about `-XQuantifiedContexts`, since this is a feature that: 1. Hasn't even landed in GHC itself (let alone been formally submitted for review) 2. Is still subject to change My suggestion would be to hold off until there's a Phabricator Diff for this, at which point you can dump all of your findings there :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | QuantifiedContexts 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 simonpj): I like having the bug reports though, and it does no harm to have them as separate tickets, provided they are clearly signposted as being on a branch, which this one is. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: wipT2893 | QuantifiedContexts 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 Iceland_jack): * keywords: QuantifiedContexts => wipT2893 QuantifiedContexts Comment: I have no issue either way, if I do make new ones I will use the keyword `wipT2893` so they're easier to track down -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: wipT2893 | QuantifiedContexts 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): Ah, OK. If Simon is alright with this state of affairs, then I have no objection :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: wipT2893, | QuantifiedConstraints 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): * keywords: wipT2893 QuantifiedContexts => wipT2893, QuantifiedConstraints -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: wipT2893, | QuantifiedConstraints 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): * status: new => closed * resolution: => fixed Comment: I think I've fixed this. Try again7 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: fixed | Keywords: wipT2893,
| QuantifiedConstraints
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 simonpj):
Commit is
{{{
commit e0d5286c8cea23ca27163abe76d63c1f10719fa2
Author: Simon Peyton Jones

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: wipT2893, | QuantifiedConstraints 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 Iceland_jack): It works now, thanks -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: fixed | Keywords: wipT2893,
| QuantifiedConstraints
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 Ben Gamari

#14735: GHC Panic with QuantifiedConstraints
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 8.2.2
Resolution: fixed | Keywords: wipT2893,
| QuantifiedConstraints
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 Ben Gamari

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: | QuantifiedConstraints 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 RyanGlScott): * keywords: wipT2893, QuantifiedConstraints => QuantifiedConstraints -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14735: GHC Panic with QuantifiedConstraints -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 Resolution: fixed | Keywords: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | typecheck/should_compile/T14735 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * testcase: => typecheck/should_compile/T14735 * milestone: => 8.6.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14735#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC