Skip to content

RebindableSyntax with pattern guards needs `fail`

If I say

{-# LANGUAGE RebindableSyntax #-}

module Bug where

foo :: (a, b) -> ()
foo x | (_,_) <- x = ()

I get

Bug.hs:6:9: error: Not in scope: ‘fail’

Yet even if I bring fail into scope, it's not mentioned in the Core produced by my program. And it really shouldn't: there's not a monad in sight!

Trac metadata
Trac field Value
Version 7.11
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