summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/ExPat.hs
blob: 2ac3cb802627d1b0fce9f56b642d5cc6a44fa0aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE ViewPatterns, GADTs #-}

module ExPat where

data T where
  MkT :: Integral a => a -> Int -> T

-- c.f. T11700

-- Succeeds because 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