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,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • 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
  • #21278
Closed
Open
Created Mar 22, 2022 by Krzysztof Gogolewski@monoidalDeveloper

Level number panic with LinearTypes

The following program

{-# LANGUAGE LinearTypes #-}
module T where

data C a = forall p. C (a %p -> a)

f :: C a -> C a
f b = C (\x -> case b of C g -> g x)

causes a level number assertion failure:

  GHC version 9.3.20220317:
	ASSERT failed!
  2
  1
  p_ax2[tau:1]
  p_ax6[ssk:2]
  Call stack:
      CallStack (from HasCallStack):
        massertPpr, called at compiler/GHC/Tc/Utils/TcMType.hs:1056:10 in ghc:GHC.Tc.Utils.TcMType

If this assertion is skipped, it fails Core Lint, due to an out-of-scope multiplicity variable.

Reproduced on 9.2 and HEAD. Related: #20232 (closed) and #18998 (closed).

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