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,836
    • Issues 4,836
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 448
    • Merge requests 448
  • 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
  • #2787

Closed
Open
Created Nov 17, 2008 by BenMoseley@trac-BenMoseley

Panic (core lint failure) with type synonym in GHC 6.10.1

This causes a panic:

{-# LANGUAGE TypeFamilies, GADTs #-}
module GHCBug (
  PVR(..),
  Core(..),
  analyseCore
)
where

data Core a where Ctr :: Core Double
data PVR a = PVR a deriving (Eq, Show)


class Sub a where
    type AssocSyn a :: * -> *

instance Sub Double where
    type AssocSyn Double = PVR


analyseCore :: Core a -> ((AssocSyn a) a)
analyseCore Ctr = pvr
  where
    -- GHC panics if we use the below as the type sig for 'pvr'
    pvr :: PVR ~ AssocSyn a => (AssocSyn a) a
    -- pvr :: (AssocSyn a) a
    pvr = undefined

main :: IO ()
main = print "ok"

The basic compiler panic is:

c:/ws/main/depot/QA/EDG/EDG_priv/FPF_Dev.br/src $ ghc -main-is GHCBug ~/GHCBug.hs
ghc.exe: panic! (the 'impossible' happened)
  (GHC version 6.10.1 for i386-unknown-mingw32):
	initC: srt_lbl

Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug

The core lint failure part is:

*** Checking old interface for main:GHCBug:
*** Parser:
*** Renamer/typechecker:
*** Desugar:
    Result size = 199
*** Core Lint Errors: in result of Desugar ***
{-# LINE 21 "F:\ME\GHCBug.hs #-}:
    [RHS of pvr_awa :: GHCBug.AssocSyn
                         GHC.Types.Double GHC.Types.Double]
    pvr_afN is out of scope
*** Offending Program ***
Trac metadata
Trac field Value
Version 6.10.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Windows
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking