testsuite: Add T11824
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 15 Apr 2016 09:41:12 +0000 (11:41 +0200)
committerBen Gamari <ben@smart-cactus.org>
Fri, 15 Apr 2016 14:24:45 +0000 (16:24 +0200)
Test Plan: Validate

Reviewers: goldfire, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2107

GHC Trac Issues: #11824

testsuite/tests/typecheck/T11824/T11824.hs [new file with mode: 0644]
testsuite/tests/typecheck/T11824/TyCon.hs [new file with mode: 0644]
testsuite/tests/typecheck/T11824/Type.hs [new file with mode: 0644]
testsuite/tests/typecheck/T11824/Type.hs-boot [new file with mode: 0644]
testsuite/tests/typecheck/T11824/Unbound/Generics/LocallyNameless.hs [new file with mode: 0644]
testsuite/tests/typecheck/T11824/all.T [new file with mode: 0644]

diff --git a/testsuite/tests/typecheck/T11824/T11824.hs b/testsuite/tests/typecheck/T11824/T11824.hs
new file mode 100644 (file)
index 0000000..ee80e4e
--- /dev/null
@@ -0,0 +1,4 @@
+import Type
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/typecheck/T11824/TyCon.hs b/testsuite/tests/typecheck/T11824/TyCon.hs
new file mode 100644 (file)
index 0000000..1d74337
--- /dev/null
@@ -0,0 +1,10 @@
+module TyCon where
+
+import Unbound.Generics.LocallyNameless (Alpha (..))
+import {-# SOURCE #-} Type   (TyName)
+
+data AlgTyConRhs
+  = NewTyCon TyName
+
+instance Alpha AlgTyConRhs where
+  isTerm (NewTyCon nm) = isTerm nm
diff --git a/testsuite/tests/typecheck/T11824/Type.hs b/testsuite/tests/typecheck/T11824/Type.hs
new file mode 100644 (file)
index 0000000..7b0a399
--- /dev/null
@@ -0,0 +1,11 @@
+module Type where
+
+import Unbound.Generics.LocallyNameless (Alpha (..),Name)
+import TyCon
+
+data TType = VarTy
+
+type TyName = Name TType
+
+instance Alpha TType where
+  isTerm VarTy = False
diff --git a/testsuite/tests/typecheck/T11824/Type.hs-boot b/testsuite/tests/typecheck/T11824/Type.hs-boot
new file mode 100644 (file)
index 0000000..3a847b9
--- /dev/null
@@ -0,0 +1,10 @@
+module Type where
+
+import Unbound.Generics.LocallyNameless (Name)
+import Data.Typeable
+
+data TType
+
+type TyName = Name TType
+
+instance Typeable TType
diff --git a/testsuite/tests/typecheck/T11824/Unbound/Generics/LocallyNameless.hs b/testsuite/tests/typecheck/T11824/Unbound/Generics/LocallyNameless.hs
new file mode 100644 (file)
index 0000000..e2c63da
--- /dev/null
@@ -0,0 +1,11 @@
+module Unbound.Generics.LocallyNameless where
+
+import Data.Typeable (Typeable)
+
+data Name a = Name
+
+class Alpha a where
+  isTerm :: a -> Bool
+
+instance Typeable a => Alpha (Name a) where
+  isTerm _ = False
diff --git a/testsuite/tests/typecheck/T11824/all.T b/testsuite/tests/typecheck/T11824/all.T
new file mode 100644 (file)
index 0000000..90aaa1e
--- /dev/null
@@ -0,0 +1 @@
+test('T11824', expect_broken(11824), compile_and_run, [''])
\ No newline at end of file