[commit: ghc] master: Add regression test for #11616 (03ca391)

git at git.haskell.org git at git.haskell.org
Thu May 4 22:23:01 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/03ca391f14f97486fd1c66d9c9d99686ae25cc10/ghc

>---------------------------------------------------------------

commit 03ca391f14f97486fd1c66d9c9d99686ae25cc10
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Thu May 4 14:19:26 2017 -0400

    Add regression test for #11616
    
    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


>---------------------------------------------------------------

03ca391f14f97486fd1c66d9c9d99686ae25cc10
 testsuite/tests/polykinds/T11616.hs | 19 +++++++++++++++++++
 testsuite/tests/polykinds/all.T     |  1 +
 2 files changed, 20 insertions(+)

diff --git a/testsuite/tests/polykinds/T11616.hs b/testsuite/tests/polykinds/T11616.hs
new file mode 100644
index 0000000..378032b
--- /dev/null
+++ b/testsuite/tests/polykinds/T11616.hs
@@ -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
diff --git a/testsuite/tests/polykinds/all.T b/testsuite/tests/polykinds/all.T
index e534e08..b59cbe6 100644
--- a/testsuite/tests/polykinds/all.T
+++ b/testsuite/tests/polykinds/all.T
@@ -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, [''])



More information about the ghc-commits mailing list