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,398
    • Issues 5,398
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 590
    • Merge requests 590
  • 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
  • #9975
Closed
Open
Issue created Jan 11, 2015 by gamegoblin@trac-gamegoblin

RecordWildcards and PatternSynonyms cause impossible bug

When using RecordWildcards with PatternSynonyms, I have found a way to cause this bug:

$ /usr/local/bin/ghc-7.10.0.20141222 test.hs 
[1 of 1] Compiling Main             ( test.hs, test.o )
ghc: panic! (the 'impossible' happened)
  (GHC version 7.10.0.20141222 for x86_64-apple-darwin):
	find_tycon
  Test
  [Test defined at test.hs:6:9,
   Test parent:Test defined at test.hs:4:13]

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

Here is the full code that causes it:

{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE PatternSynonyms #-}
data Test = Test { x :: Int }
pattern Test wat = Test { x = wat }

If you remove RecordWildCards, the bug does not happen.

Edited Mar 10, 2019 by Herbert Valerio Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking