[GHC] #7838: ghc(i) crashes on instance declaration

#7838: ghc(i) crashes on instance declaration -----------------------------+---------------------------------------------- Reporter: alios | Owner: Type: bug | Status: new Priority: normal | Component: Compiler Version: 7.6.2 | Keywords: MultiParamTypeClasses Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Blockedby: Blocking: | Related: -----------------------------+---------------------------------------------- {{{ multiple lines, ''no wiki'' {-# LANGUAGE MultiParamTypeClasses, TypeFamilies, ConstraintKinds, UndecidableInstances, FunctionalDependencies, FlexibleInstances #-} {- after declaring the instance instance TS TST TT m where below my ghci crashes on arch linux x86_64, if you comment it out no crash happens. ghc: panic! (the 'impossible' happened) (GHC version 7.6.2 for x86_64-unknown-linux): getClassPredTys <<details unavailable>> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug -} module Crash where class T t where type TPI t :: * class (T t, C (TPI t) m (TPI t)) => TC c t m | c -> t class (T t, C (TPI t) m (TPI t)) => TS s t m | s -> t data C i m o data TST data TT instance TS TST TT m where }}} -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7838 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7838: ghc(i) crashes on instance declaration --------------------------------------+------------------------------------- Reporter: alios | Owner: Type: bug | Status: closed Priority: normal | Component: Compiler Version: 7.6.2 | Resolution: fixed Keywords: MultiParamTypeClasses | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Blockedby: | Blocking: Related: | --------------------------------------+------------------------------------- Changes (by monoidal): * status: new => closed * resolution: => fixed Comment: Thanks for the report. The bug is already fixed in HEAD. Now you get: {{{ A.hs:28:13: Expected a constraint, but ‛C (TPI t) m (TPI t)’ has kind ‛*’ In the class declaration for ‛TS’ }}} Here's a reduced version: {{{ {-# LANGUAGE ConstraintKinds, UndecidableInstances, FlexibleInstances #-} module Crash where data C m class (C m) => TS m instance TS m where }}} Once you change "data C m" to "class C m", there's no panic. Sometimes 7.6 does not enforce the difference between kinds Constraint and * during type-checking. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7838#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC