summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/typecheck/should_compile/T4404.hs
blob: 894066542a6d875ce97dff74e7216f6d901d278e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE RecordWildCards, DoRec #-}

module TT where

data T = T {t1, t2 :: Int}

f :: T -> Int
f d = x
    where T {t1 = x, ..} = d

g :: T -> Int
g (T {t1 = x, ..}) = x

-- The fix to this test also affected the dorec checking code, hence this:
h :: Maybe Int
h = do
    rec
      T {t1 = x, ..} <- Just $ T 1 1
    return x