summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-01-19 16:30:26 +0100
committerBen Gamari <ben@smart-cactus.org>2016-01-20 17:08:05 +0100
commit5cce09543db827e662539523ffff4513deb92777 (patch)
tree56b57340d0853f6a59377119cadb5863f57866bd /testsuite
parent0373a8458a9d5ed0732d06ffd082b939c11b6adc (diff)
downloadhaskell-5cce09543db827e662539523ffff4513deb92777.tar.gz
Use (&&) instead of `if` in Ix derivation
We were previously using `if` in the derivation of `Ix` instances. This interacts badly with RebindableSyntax as the typechecker doesn't infer the type of the argument we give to `tagToEnum#`. Previously we produced, `if (ch >= ah) then (ch <= bh) else False`. We now produce `(ch >= ah) && (ch <= bh)` Fixes #11396. Test Plan: Validate Reviewers: austin, simonpj Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1797 GHC Trac Issues: #11396
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/deriving/should_compile/T11396.hs11
-rw-r--r--testsuite/tests/deriving/should_compile/all.T1
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/deriving/should_compile/T11396.hs b/testsuite/tests/deriving/should_compile/T11396.hs
new file mode 100644
index 0000000000..ecb930c6c7
--- /dev/null
+++ b/testsuite/tests/deriving/should_compile/T11396.hs
@@ -0,0 +1,11 @@
+{-# LANGUAGE RebindableSyntax #-}
+module IfThenElseIx where
+
+import Data.Ix (Ix, )
+import Prelude
+
+ifThenElse :: Bool -> a -> a -> a
+ifThenElse True x _ = x
+ifThenElse False _ x = x
+
+data T = A | B deriving (Eq, Ord, Ix)
diff --git a/testsuite/tests/deriving/should_compile/all.T b/testsuite/tests/deriving/should_compile/all.T
index a18a257ff2..4589a86497 100644
--- a/testsuite/tests/deriving/should_compile/all.T
+++ b/testsuite/tests/deriving/should_compile/all.T
@@ -62,3 +62,4 @@ test('T11148', normal, run_command,
['$MAKE -s --no-print-directory T11148'])
test('T9968', normal, compile, [''])
test('T11416', normal, compile, [''])
+test('T11396', normal, compile, [''])