summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc129.hs
blob: 56163ffe3106577573a94758ef2bb8d1281ddf85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE ImplicitParams #-}

-- !!! Test inheritance of implicit parameters.
-- GHC 5.00.2 fails this test

-- The thing is to do with whether an implicit parameter
-- constraint can be "inherited".  See notes in TcSimplify.lhs

module ShouldCompile where

data R = R {f :: Int}

foo :: (?x :: Int) => R -> R
foo r = r {f = ?x}

baz :: (?x :: Int) => Int
baz = (?x +1) :: Int