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,830
    • Issues 4,830
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 447
    • Merge requests 447
  • 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
  • #16517

Closed
Open
Created Apr 01, 2019 by Ryan Scott@RyanGlScottMaintainer

GHC 8.8 (or later)-only panic (metaTyVarRef)

The following code panics on GHC 8.8 or later:

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
module Bug where

import Data.Proxy

class C f where
  m :: f (p :: Proxy a)
$ ~/Software/ghc5/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )
ghc-stage2: panic! (the 'impossible' happened)
  (GHC version 8.9.20190330 for x86_64-unknown-linux):
        metaTyVarRef
  f_avi
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/utils/Outputable.hs:1169:37 in ghc:Outputable
        pprPanic, called at compiler/typecheck/TcType.hs:1215:14 in ghc:TcType

On GHC 8.6.4, this simply produces an error message:

$ /opt/ghc/8.6.4/bin/ghc Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:8:8: error:
    • Expected kind ‘Proxy a -> *’, but ‘f’ has kind ‘k0’
    • In the type signature: m :: f (p :: Proxy a)
      In the class declaration for ‘C’
  |
8 |   m :: f (p :: Proxy a)
  |        ^^^^^^^^^^^^^^^^
Edited Apr 01, 2019 by Ryan Scott
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking