Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 639
    • Merge requests 639
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • 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
  • #3297

Compiler panic on incorrect code (TcTyFuns.flattenType: synonym family in a rank-n type)

On the following code sample the compiler panics with:

 ghc: panic! (the 'impossible' happened)
  (GHC version 6.11.20090403 for i386-unknown-linux):
	TcTyFuns.flattenType: synonym family in a rank-n type

I found this when working on some code when I made a mistake; the code should not type check, but should probably not crash the compiler either. I simplified the code to:

{-# LANGUAGE TypeFamilies
           , KindSignatures
           , RankNTypes
           #-}

type family PF a :: (* -> *) -> * -> *

class Ix a where
    type Es a :: * -> *
    from  :: a          -> PF a (Es a) a

crash :: (forall n. Es a n) -> a
crash = from

It seems similar to #3101 (closed), but that one was about data types. A similar example also seems to be in #1897 (closed), but this bug doesn't seem to fit that ticket's description.

Trac metadata
Trac field Value
Version 6.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking