summaryrefslogtreecommitdiff
path: root/testsuite/tests/overloadedrecflds/should_fail/overloadedrecfldsfail01a.hs
blob: be7284267ebd7e7c53f12bee037b9f2891fb7421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Test ambiguous updates are rejected with appropriate error messages

{-# LANGUAGE DuplicateRecordFields #-}

module OverloadedRecFieldsFail1a where

data R = MkR { w :: Bool, x :: Int, y :: Bool }
data S = MkS { w :: Bool, x :: Int, y :: Bool }
data T = MkT { x :: Int, z :: Bool }
data U = MkU { y :: Bool }

-- Straightforward ambiguous update
upd1 r = r { x = 3 }