summaryrefslogtreecommitdiff
path: root/testsuite/tests/overloadedrecflds/ghci/overloadedrecfldsghci01.script
blob: 2aa0a15be8e68f2e897d2a2a307d2e2beaf9229e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

:set -XDuplicateRecordFields
data S = MkS { foo :: Int }
data T a = MkT { foo :: Bool, bar :: a -> a }
let t = MkT { foo = True, bar = id }
(\MkT{foo=foo} -> foo) t
:info foo
:type foo
foo (MkS 42)
bar (MkT True id) True
:set -XNoDuplicateRecordFields
-- Should be ambiguous
:type foo
data U = MkU { foo :: Int }
-- New foo should shadow the old ones
:type foo
foo (MkU 42)