[commit: ghc] ghc-8.2: Add regression test for #11616 (df44a60)

git at git.haskell.org git at git.haskell.org
Fri May 5 02:54:57 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/df44a60a5b98490cf02b8b91f292de935e6da1df/ghc

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

commit df44a60a5b98490cf02b8b91f292de935e6da1df
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
    
    (cherry picked from commit 03ca391f14f97486fd1c66d9c9d99686ae25cc10)


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

df44a60a5b98490cf02b8b91f292de935e6da1df
 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 8684ec4..cb09629 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