summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc113.hs
blob: 2ead3c279812a7456aeb19b58cc2bc619d1f4877 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}

-- !!! Monomorphism restriction

module ShouldCompile where

foo :: Eq a => a -> b -> b
foo x y = y

-- Expect test2 :: forall b. b->b
-- despite the monomorphism restriction
poly = foo (3::Int)

-- Check that test2 is polymorphic
test = (poly True, poly 'c')