Commit 68a084f3 authored by thomie's avatar thomie

Testsuite: add test for #10997

parent bb7e93c9
module T10997 where
import T10997a
{- With ghc-7.10.2:
The interface for ‘T10997a’
Declaration for Just'
Pattern synonym Just':
Iface type variable out of scope: k
Cannot continue after interface file error
-}
bar :: (Showable a) => Maybe a -> Maybe a
bar (Just' a) = Just' a
{-# LANGUAGE PatternSynonyms, ViewPatterns, ConstraintKinds, TypeFamilies, PolyKinds, KindSignatures #-}
module T10997a where
import GHC.Exts
type family Showable (a :: k) :: Constraint where
Showable (a :: *) = (Show a)
Showable a = ()
extractJust :: Maybe a -> (Bool, a)
extractJust (Just a) = (True, a)
extractJust _ = (False, undefined)
pattern Just' :: () => (Showable a) => a -> (Maybe a)
pattern Just' a <- (extractJust -> (True, a)) where
Just' a = Just a
......@@ -479,3 +479,5 @@ test('T10770a', expect_broken(10770), compile, [''])
test('T10770b', expect_broken(10770), compile, [''])
test('T10935', normal, compile, [''])
test('T10971a', normal, compile, [''])
test('T10997', expect_broken(10997),
multi_compile, ['T10997', [('T10997a.hs', '')], '-v0'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment