Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#10112 closed bug (fixed)

Desugaring of do-syntax intros unification var with -XRebindableSyntax

Reported by: heisenbug Owned by:
Priority: normal Milestone: 8.0.1
Component: Compiler Version: 7.8.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: rebundable/T10112
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

When compiling below snippet with GHC 7.8.x (and I believe v7.10.x)

{-# LANGUAGE RankNTypes, RebindableSyntax #-}

import qualified Prelude as P

(>>=) :: a -> ((forall b . b) -> c) -> c
a >>= f = f P.undefined
return a = a
fail s = P.undefined

t1 = 'd' >>= (\_ -> 'k')

t2 = do _ <- 'd'
        'k'

main = P.putStrLn [t1, t2]

we get this error:

Ztest.hs:12:9:
    Cannot instantiate unification variable `t0`
    with a type involving foralls: forall b. b
      Perhaps you want ImpredicativeTypes
    In a stmt of a 'do' block: _ <- 'd'
    In the expression:
      do { _ <- 'd';
           'k' }
    In an equation for `t2`:
        t2
          = do { _ <- 'd';
                 'k' }
Failed, modules loaded: none.

In GHC HEAD (and v7.6.x) the error does not appear. Nevertheless I'll file this bug for addition of a regression test.

Discussion here: https://mail.haskell.org/pipermail/ghc-devs/2015-February/008383.html

Change History (4)

comment:1 Changed 5 years ago by simonpj

Test Case: rebundable/T10112

I'll do that.

Simon

comment:2 Changed 5 years ago by Simon Peyton Jones <simonpj@…>

comment:3 Changed 5 years ago by simonpj

Resolution: fixed
Status: newclosed

Regression test added

comment:4 Changed 4 years ago by thomie

Milestone: 8.0.1
Note: See TracTickets for help on using tickets.