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,242
    • Issues 5,242
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 564
    • Merge requests 564
  • 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
  • #2587
Closed
Open
Issue created Sep 12, 2008 by Neil Mitchell@ndmitchellReporter

Optimiser bug with extistentials and GADT's

Given the program:

{-# LANGUAGE GADTs, ExistentialQuantification #-}
module GadtBug(bug) where

data Existential = forall a . Existential (Gadt a)

data Gadt a where Value :: Gadt Double


bug = [ match undefined | ps <- undefined, _ <- ps ]
  where
        match (Existential _) = undefined
        match (Existential _) = undefined

Using GHC Head from yesterday, compiling without optimisations I get:

C:\Neil>ghc --make GadtBug.hs
[1 of 1] Compiling GadtBug          ( GadtBug.hs, GadtBug.o )

GadtBug.hs:11:8:
    Warning: Pattern match(es) are overlapped
             In the definition of `match': match (Existential _) = ...

With optimisations (-O or -O2) I get:

C:\Neil\paradise-bug-csdg\alone>ghc --make GadtBug.hs -O
[1 of 1] Compiling GadtBug          ( GadtBug.hs, GadtBug.o )

GadtBug.hs:11:8:
    Warning: Pattern match(es) are overlapped
             In the definition of `match': match (Existential _) = ...
ghc: panic! (the 'impossible' happened)
  (GHC version 6.9.20080905 for i386-unknown-mingw32):
        idInfo a{tv ag4} [sk]

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

-- Neil

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