Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,393
    • Issues 4,393
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 376
    • Merge Requests 376
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #16517

Closed
Open
Opened 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
Assignee
Assign to
8.8.1
Milestone
8.8.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16517