summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-10-11 16:17:41 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-10-11 16:17:41 +0100
commit13fdca3d174ff15ac347c5db78370f457a3013ee (patch)
treed722a90609f17f1c819fbdaa1c870928b232d226 /testsuite/tests/deriving/should_compile
parent4bb54a4522d44a81b2c47233f48252bd73c38279 (diff)
downloadhaskell-13fdca3d174ff15ac347c5db78370f457a3013ee.tar.gz
Add a missing zonk in TcDerivInfer.simplifyDeriv
I'm astonished that anything worked without this! Fixes Trac #14339
Diffstat (limited to 'testsuite/tests/deriving/should_compile')
-rw-r--r--testsuite/tests/deriving/should_compile/T14339.hs17
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
2 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T14339.hs b/testsuite/tests/deriving/should_compile/T14339.hs
new file mode 100644
index 0000000000..e2521f2de0
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T14339.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE DataKinds #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE UndecidableInstances #-}
+module Bug where
+
+import GHC.TypeLits
+
+newtype Baz = Baz Foo
+ deriving Bar
+
+newtype Foo = Foo Int
+
+class Bar a where
+ bar :: a
+
+instance (TypeError (Text "Boo")) => Bar Foo where
+ bar = undefined
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 65c6d7284e..82cee03450 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -96,3 +96,4 @@ test('T13919', normal, compile, [''])
test('T13998', normal, compile, [''])
test('T14045b', normal, compile, [''])
test('T14094', normal, compile, [''])
+test('T14339', normal, compile, [''])