diff options
Diffstat (limited to 'testsuite/tests/patsyn/should_compile')
-rw-r--r-- | testsuite/tests/patsyn/should_compile/T17775-singleton.hs | 18 | ||||
-rw-r--r-- | testsuite/tests/patsyn/should_compile/all.T | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T17775-singleton.hs b/testsuite/tests/patsyn/should_compile/T17775-singleton.hs new file mode 100644 index 0000000000..651dff583a --- /dev/null +++ b/testsuite/tests/patsyn/should_compile/T17775-singleton.hs @@ -0,0 +1,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 + diff --git a/testsuite/tests/patsyn/should_compile/all.T b/testsuite/tests/patsyn/should_compile/all.T index 6ef1928768..75be0c68b2 100644 --- a/testsuite/tests/patsyn/should_compile/all.T +++ b/testsuite/tests/patsyn/should_compile/all.T @@ -78,3 +78,4 @@ test('T14394', normal, ghci_script, ['T14394.script']) test('T14498', normal, compile, ['']) test('T16682', [extra_files(['T16682.hs', 'T16682a.hs'])], multimod_compile, ['T16682', '-v0 -fwarn-incomplete-patterns -fno-code']) +test('T17775-singleton', normal, compile, ['']) |