Add regression test for #11616
authorRyan Scott <ryan.gl.scott@gmail.com>
Thu, 4 May 2017 18:19:26 +0000 (14:19 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 4 May 2017 22:20:45 +0000 (18:20 -0400)
The code in #11616 has been working for a while (ever since 8.0.1),
so let's add a regression test for it to put the nail in the coffin.

Test Plan: make test TEST=T11616

Reviewers: austin, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #11616

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

testsuite/tests/polykinds/T11616.hs [new file with mode: 0644]
testsuite/tests/polykinds/all.T

diff --git a/testsuite/tests/polykinds/T11616.hs b/testsuite/tests/polykinds/T11616.hs
new file mode 100644 (file)
index 0000000..378032b
--- /dev/null
@@ -0,0 +1,19 @@
+{-# LANGUAGE AllowAmbiguousTypes #-}
+{-# LANGUAGE TypeApplications #-}
+{-# LANGUAGE TypeInType #-}
+module T11616 where
+
+class Whoami a where
+  whoami :: String
+
+instance Whoami Int where
+  whoami = "int"
+
+instance Whoami Bool where
+  whoami = "[y/n]"
+
+instance Whoami Maybe where
+  whoami = "call me maybe"
+
+whoisint :: String
+whoisint = whoami @Int
index e534e08..b59cbe6 100644 (file)
@@ -140,6 +140,7 @@ test('T11362', normal, compile, ['-dunique-increment=-1'])
   # -dunique-increment=-1 doesn't work inside the file
 test('T11399', normal, compile_fail, [''])
 test('T11611', normal, compile_fail, [''])
+test('T11616', normal, compile, [''])
 test('T11648', normal, compile, [''])
 test('T11648b', normal, compile_fail, [''])
 test('KindVType', normal, compile_fail, [''])