panic! (the 'impossible' happened) with evil self-referential instance
This bit of code escaped from my fingertips:
{-# LANGUAGE ConstraintKinds, FlexibleInstances, TypeFamilies,
UndecidableInstances #-}
class ctx (Arg ctx) => Some ctx where type Arg ctx
instance ctx a => Some ctx where type Arg ctx = a
and crashed GHC master with:
ghc: panic! (the 'impossible' happened)
(GHC version 7.3.20110927 for x86_64-unknown-linux):
tcTyVarDetails a{tv aav} [tv]
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
This causes a similar crash without using ConstraintKinds:
{-# LANGUAGE FlexibleContexts, FlexibleInstances, MultiParamTypeClasses,
TypeFamilies, UndecidableInstances #-}
class C f a
class C f (Arg f) => Some f where type Arg f
instance C f a => Some f where type Arg f = a
Trac metadata
Trac field | Value |
---|---|
Version | 7.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |