Skip to content

GitLab

  • Menu
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 4,867
    • Issues 4,867
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 457
    • Merge requests 457
  • 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 Compiler
  • GHCGHC
  • Issues
  • #21130
Closed
Open
Created Feb 24, 2022 by Krzysztof Gogolewski@monoidalDeveloper

mkCoCast panic in 9.2

The following file causes a panic in 9.2.1 and on the ghc-9.2 branch

{-# LANGUAGE TypeFamilies, FlexibleContexts #-}
module M where

type family Item l
type instance Item [a] = a

f :: Enum (Item l) => l
f = f

x = (_ f) :: Int
  (GHC version 9.2.0.20220224:
	mkCoCast
  (Enum (Sym (D:R:Item[][0] <Char>_N)))_R
  Enum Char ~ Enum (Item [Char])
  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/Coercion.hs:1675:5 in ghc:GHC.Core.Coercion

HEAD is good:

M.hs:10:6: error:
    • Found hole: _ :: t0 -> Int
      Where: ‘t0’ is an ambiguous type variable

I haven't checked which commit fixed it. There are no other tickets mentioning mkCoCast, so I think it's worth checking if the bug is actually fixed or merely hidden.

Credits to Dominic Steinitz for the initial report.

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