diff options
Diffstat (limited to 'testsuite/tests/typecheck/should_compile/ExPat.hs')
-rw-r--r-- | testsuite/tests/typecheck/should_compile/ExPat.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_compile/ExPat.hs b/testsuite/tests/typecheck/should_compile/ExPat.hs new file mode 100644 index 0000000000..a0b4b0b007 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/ExPat.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE ViewPatterns, GADTs #-} + +module ExPat where + +data T where + MkT :: Integral a => a -> Int -> T + +-- c.f. T11700 + +-- Succeeds becuase y::Int +f x = let MkT _ y = x + in y + +-- Remarkablly, this succeeds because +-- (toInteger (v::a)) is an Integer +g x = let MkT (toInteger -> y) _ = x + in y |