diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_fail/T21158.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_fail/T21158.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_fail/T21158.hs b/testsuite/tests/typecheck/should_fail/T21158.hs new file mode 100644 index 0000000000..282989f5b8 --- /dev/null +++ b/testsuite/tests/typecheck/should_fail/T21158.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE TypeFamilies #-} +module T21158 where + +type family F a + +data T b = MkT { x :: [Int], y :: [F b] } + +emptyT :: T b +emptyT = MkT [] [] + +foo1 :: [Int] -> T b +foo1 newx = emptyT { x = newx } + +foo2 :: [Int] -> T b +foo2 newx = case emptyT of MkT x y -> MkT newx y |