Kill inaccessible-branch complaints in record update
[ghc.git] / testsuite / tests / pmcheck / should_compile / T12957a.hs
1 {-# LANGUAGE RecordWildCards #-}
2 {-# LANGUAGE DataKinds #-}
3 {-# LANGUAGE GADTs #-}
4 {-# LANGUAGE KindSignatures #-}
5
6 -- The original test case for Trac #12957
7
8 module T12957a where
9
10 data T = A | B
11
12 data Fields (t :: T) where
13 BFields :: { list :: [()] } -> Fields 'B
14
15 AFields :: Fields 'A
16
17 EmptyFields :: Fields t
18
19 emptyA :: Fields 'A
20 emptyA = AFields
21
22 data S t = S { sFields :: Fields t }
23
24 f :: () -> S 'A
25 f a = (S EmptyFields) { sFields = emptyA { list = [ a ] } }