summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2016-10-15 11:11:20 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2016-10-15 11:11:21 -0400
commitb501709ed79ba03e72518ef9dd101ce2d03db2de (patch)
tree0b3c3cfa724c39fdcaaf3426f6cc4044d4f1b7f6 /testsuite/tests
parente39589e2e4f788565c4a7f02cb85802214a95757 (diff)
downloadhaskell-b501709ed79ba03e72518ef9dd101ce2d03db2de.tar.gz
Fix Show derivation in the presence of RebindableSyntax/OverloadedStrings
Summary: To fix this issue, we simply disable `RebindableSyntax` whenever we rename the code generated from a deriving clause. Fixes #12688. Test Plan: make test TEST=T12688 Reviewers: simonpj, austin, bgamari Reviewed By: simonpj, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2591 GHC Trac Issues: #12688
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/deriving/should_compile/T12688.hs15
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T12688.hs b/testsuite/tests/deriving/should_compile/T12688.hs
new file mode 100644
index 0000000000..0735a81138
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T12688.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE RebindableSyntax, OverloadedStrings #-}
+module T12688 where
+
+import Prelude (String,Show(..))
+
+newtype Text = Text String
+
+fromString :: String -> Text
+fromString = Text
+
+x :: Text
+x = "x"
+
+newtype Foo = Foo ()
+ deriving (Show)
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index 26312df3e9..bd1f07abe6 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -76,3 +76,4 @@ test('T12245', normal, compile, [''])
test('T12399', normal, compile, [''])
test('T12583', normal, compile, [''])
test('T12616', normal, compile, [''])
+test('T12688', normal, compile, [''])