Opened 8 months ago

Closed 8 months ago

#14591 closed bug (fixed)

HEAD panic: tcSyntaxOp "noSyntaxExpr"

Reported by: tianxiaogu Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.2.2
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: Compile-time crash or panic Test Case: rename/should_fail/T14591
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

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}}}

Attachments (1)

bug.hs (324 bytes) - added by tianxiaogu 8 months ago.

Download all attachments as: .zip

Change History (3)

Changed 8 months ago by tianxiaogu

Attachment: bug.hs added

comment:1 Changed 8 months ago by Simon Peyton Jones <simonpj@…>

In 23b5b80/ghc:

Add missing case to HsExpr.isMonadFailStmtContext

This fixes Trac #14591

I took the opportunity to delete the dead code isMonadCompExpr

comment:2 Changed 8 months ago by simonpj

Resolution: fixed
Status: newclosed
Test Case: rename/should_fail/T14591
Note: See TracTickets for help on using tickets.