Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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 4,838
    • Issues 4,838
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 449
    • Merge requests 449
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #20426

Closed
Open
Created Sep 28, 2021 by sheaf@sheafMaintainer

Levity-polymorphic GADT causes a panic (tyConAppTyCon)

On any version of GHC that supports UnliftedDatatypes (e.g. 9.2), the following program causes a panic:

{-# LANGUAGE StandaloneKindSignatures, MagicHash, ExplicitForAll, PolyKinds,
             DataKinds, UnliftedDatatypes, GADTs #-}

module RepPolyGADT where

import GHC.Exts

type LPGADT :: forall (l :: Levity) -> TYPE (BoxedRep l)
data LPGADT l where
  MkLifted   :: Int  -> LPGADT Lifted
  MkUnlifted :: Int# -> LPGADT Unlifted

getInt# :: LPGADT l -> Int#
getInt# (MkLifted (I# i#)) = i#
getInt# (MkUnlifted i#)    = i#
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 9.2.0.20210331:
        tyConAppTyCon
  l_ayy
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler\\GHC\\Utils\\Panic.hs:181:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler\\GHC\\Core\\Type.hs:1426:52 in ghc:GHC.Core.Type
Edited Sep 28, 2021 by sheaf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking