summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/T13785.hs
blob: f02f04de35470428bbdaca60552b2bb2e84dbf09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS_GHC -Wmonomorphism-restriction #-}
module Bug where

class Monad m => C m where
  c :: (m Char, m Char)

foo :: forall m. C m => m Char
foo = bar >> baz >> bar2
  where
    -- Should not get MR warning
    bar, baz :: m Char
    (bar, baz) = c

    -- Should get MR warning
    (bar2, baz2) = c