[commit: ghc] ghc-8.2: Add regression test for #12104 (477e7d2)

git at git.haskell.org git at git.haskell.org
Sun Apr 30 17:26:05 UTC 2017


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

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

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

commit 477e7d2860b2c68c820db004e4ad094f162632ea
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Apr 28 13:24:11 2017 -0400

    Add regression test for #12104
    
    Commit 2f9f1f86849ebc18af409c9b3fd809c9cd464021
    (#13487) fixes #12104 as well. This adds a regression test for the
    program reported in #12104 to keep it fixed.
    
    Test Plan: make test TEST=T12104
    
    Reviewers: bgamari, austin
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #12104
    
    Differential Revision: https://phabricator.haskell.org/D3495
    
    (cherry picked from commit 69b9b853e3e68191cdfa8aec0e4da966298a2659)


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

477e7d2860b2c68c820db004e4ad094f162632ea
 testsuite/tests/typecheck/should_compile/T12104.hs     | 11 +++++++++++
 testsuite/tests/typecheck/should_compile/T12104.stderr |  5 +++++
 testsuite/tests/typecheck/should_compile/all.T         |  1 +
 3 files changed, 17 insertions(+)

diff --git a/testsuite/tests/typecheck/should_compile/T12104.hs b/testsuite/tests/typecheck/should_compile/T12104.hs
new file mode 100644
index 0000000..12c309c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12104.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE TypeFamilies, DataKinds, UndecidableInstances #-}
+
+module T12104 where
+
+import GHC.TypeLits
+
+type family F a where
+  F a = TypeError (Text "error")
+
+err :: F ()
+err = ()
diff --git a/testsuite/tests/typecheck/should_compile/T12104.stderr b/testsuite/tests/typecheck/should_compile/T12104.stderr
new file mode 100644
index 0000000..7848551
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T12104.stderr
@@ -0,0 +1,5 @@
+
+T12104.hs:11:7: warning: [-Wdeferred-type-errors (in -Wdefault)]
+    • error
+    • In the expression: ()
+      In an equation for ‘err’: err = ()
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 1e98ec5..29832d9 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -510,6 +510,7 @@ test('T11339c', normal, compile, [''])
 test('T11339d', normal, compile, [''])
 test('T11974', normal, compile, [''])
 test('T12067', [], multimod_compile, ['T12067', '-v0'])
+test('T12104', normal, compile, ['-fdefer-type-errors'])
 test('T12185', normal, compile, [''])
 test('T12133', normal, compile, [''])
 test('T12381', normal, compile, [''])



More information about the ghc-commits mailing list