summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn/should_compile/T17775-singleton.hs
blob: 651dff583ab5d3dd65e6a96cec801d1adc5b440d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ViewPatterns #-}
module Bug where

-- Ryan Scott (on MR !2600) said this failed

type T = forall a. a -> ()

toT :: () -> T
toT x _ = x

pattern ToT :: T -> ()
pattern ToT{x} <- (toT -> x)

-- f (toT -> (x::T)) = True