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,259
    • Issues 5,259
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • 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
  • #20356
Closed
Open
Issue created Sep 10, 2021 by Richard Eisenberg@raeDeveloper

Constraint-vs-Type causes a panic

@monoidal observes in #11715 (comment 375240) that

{-# LANGUAGE TypeFamilies, PolyKinds, ConstraintKinds #-}
import GHC.Types
type family Id (a :: k -> Constraint) :: l -> Constraint
type instance Id f = f

type T :: Constraint -> Constraint
type T = Id Eq

data Proxy p = MkProxy

id' :: f a -> f a
id' x = x

z = id' (MkProxy @T)

causes


<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.3.20210824:
	ASSERT failed!
  Ill-kinded update to meta tyvar
    a_aIJ[tau:1] :: Constraint -> Constraint
                    Constraint -> Constraint := Eq :: * -> Constraint
  Call stack:
      CallStack (from HasCallStack):
        massertPpr, called at compiler/GHC/Tc/Utils/TcMType.hs:1009:10 in ghc:GHC.Tc.Utils.TcMType

when assertions are enabled (e.g. a DEBUG compiler).

Constraint-vs-Type is a difficult problem (see #11715 (closed)), but I think we can pull this off and fix it. I imagine we just need to change an eqType to tcEqType somewhere.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking