Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,343
    • Issues 5,343
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 570
    • Merge requests 570
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14520
Closed
Open
Issue created Nov 24, 2017 by Icelandjack@IcelandjackReporter

GHC panic (TypeInType)

{-# Language TypeInType, TypeFamilies, TypeOperators #-}

import Data.Kind

type a ~>> b = (a, b) -> Type

data family Sing (a::k)

type family
  (·) (f::a~>>b) (x::a)::b

class PCategory kat where
  type Id  ::kat·a·a
  type Comp::kat·b·c -> kat·a·b -> kat·a·c

class SCategory kat where
  sId   :: Sing a -> Sing (Id::kat a a)
  sComp :: Sing f -> Sing g -> Sing (Comp f g)

triggers a panic

$ ghci -ignore-dot-ghci Bug.hs
GHCi, version 8.3.20171122: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( Bug.hs, interpreted )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 8.3.20171122 for x86_64-unknown-linux):
	piResultTy
  k_a1KI[tau:1]
  a_a1vb[sk:1]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1147:37 in ghc:Outputable
        pprPanic, called at compiler/types/Type.hs:951:35 in ghc:Type
        piResultTy, called at compiler/types/Type.hs:2309:34 in ghc:Type
        typeKind, called at compiler/types/Type.hs:2309:46 in ghc:Type
        typeKind, called at compiler/typecheck/TcType.hs:1706:11 in ghc:TcType

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
Trac metadata
Trac field Value
Version 8.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking