Skip to content

HEAD panic: tcSyntaxOp "noSyntaxExpr"

The following program triggers a bug in 8.2.2 and 8.5.20171215.

-- Checks that the ordering constraint on the groupWith function is respected
{-# OPTIONS_GHC -XMonadComprehensions -XTransformListComp #-}
module ShouldFail where
import GHC.Exts (groupWith)
data Unorderable = Gnorf | Pinky | Brain
foo = [ ()
      | Gnorf <- [Gnorf, Brain]
      , then group by x using groupWith
      ]

Reproduce:

ghc bug.hs

Output:

` [1 of 1] Compiling ShouldFail ( bug.hs, bug.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.5.20171215 for x86_64-unknown-linux): tcSyntaxOp "noSyntaxExpr" Call stack: CallStack (from HasCallStack): callStackDoc, called at compiler/utils/Outputable.hs:1150:37 in ghc:Outputable pprPanic, called at compiler/typecheck/TcExpr.hs:1436:31 in ghc:TcExpr

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

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
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