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,828
    • Issues 4,828
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 446
    • Merge requests 446
  • 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
  • #19140

Closed (duplicated)
(duplicated)
Open
Created Dec 31, 2020 by Jakob Brünker@JakobBruenkerDeveloper

panic: No skolem info when trying to use variable with polymorphic kind as Type/Constraint

Summary

In a quantified constraint in the context for an instance declaration, when trying to use a type variable with a polymorphic kind as either a Type or a Constraint, ghc will panic.

Steps to reproduce

Each of the following three instances trigger the error

{-# LANGUAGE ExplicitForAll , PolyKinds #-}

instance (forall (a :: k) . a) => Show b
instance (forall (a :: k) . Show a) => Show b
instance (forall (a :: k) . a -> a) => Show b

Error:

ghc: panic! (the 'impossible' happened)
  (GHC version 9.0.0.20201227:
        No skolem info:
  [k_aEZ[sk:1]]
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Outputable.hs:1230:37 in ghc:GHC.Utils.Outputable
        pprPanic, called at compiler/GHC/Tc/Errors.hs:2810:17 in ghc:GHC.Tc.Errors

Expected behavior

8.10 has the expected behavior: show the following type error

Bug.hs:3:29: error:
    • Expected a constraint, but ‘a’ has kind ‘k’
    • In the instance declaration for ‘Show b’
  |
3 | instance (forall (a :: k) . a) => Show b
  |                             ^

Bug.hs:4:34: error:
    • Expected a type, but ‘a’ has kind ‘k’
    • In the first argument of ‘Show’, namely ‘a’
      In the instance declaration for ‘Show b’
  |
4 | instance (forall (a :: k) . Show a) => Show b
  |                                  ^

Bug.hs:5:29: error:
    • Expected a constraint, but ‘a -> a’ has kind ‘*’
    • In the instance declaration for ‘Show b’
  |
5 | instance (forall (a :: k) . a -> a) => Show b
  |                             ^^^^^^
Failed, no modules loaded.

Environment

  • GHC version used: 9.0.0.20201227

Optional:

  • Operating System: Ubuntu inside WSL2 inside Windows 10
  • System Architecture: x86_64
Edited Dec 31, 2020 by Jakob Brünker
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking