[commit: ghc] ghc-8.2: Fix #13947 by checking for unbounded names more (45588a0)
git at git.haskell.org
git at git.haskell.org
Fri Aug 25 19:11:50 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.2
Link : http://ghc.haskell.org/trac/ghc/changeset/45588a00c06d5ee5a0fe24974f586340ab03d2de/ghc
>---------------------------------------------------------------
commit 45588a00c06d5ee5a0fe24974f586340ab03d2de
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date: Tue Jul 11 13:59:29 2017 -0400
Fix #13947 by checking for unbounded names more
Commit 2484d4dae65c81f218dcfe494b963b2630bb8fa6 accidentally dropped a
call to `isUnboundName` in an important location. This re-adds it.
Fixes #13947.
Test Plan: make test TEST=T13947
Reviewers: adamgundry, austin, bgamari
Reviewed By: adamgundry
Subscribers: rwbarton, thomie
GHC Trac Issues: #13947
Differential Revision: https://phabricator.haskell.org/D3718
(cherry picked from commit 85ac65c5f0b057f1b07ed7bf9a8d9aeae4ce1390)
>---------------------------------------------------------------
45588a00c06d5ee5a0fe24974f586340ab03d2de
compiler/rename/RnTypes.hs | 5 +++--
testsuite/tests/rename/should_fail/T13947.hs | 5 +++++
testsuite/tests/rename/should_fail/T13947.stderr | 3 +++
testsuite/tests/rename/should_fail/all.T | 1 +
4 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/compiler/rename/RnTypes.hs b/compiler/rename/RnTypes.hs
index f829c4f..58d7c9f 100644
--- a/compiler/rename/RnTypes.hs
+++ b/compiler/rename/RnTypes.hs
@@ -1421,8 +1421,9 @@ sectionPrecErr op@(n1,_) arg_op@(n2,_) section
nest 4 (text "in the section:" <+> quotes (ppr section))]
is_unbound :: OpName -> Bool
-is_unbound UnboundOp{} = True
-is_unbound _ = False
+is_unbound (NormalOp n) = isUnboundName n
+is_unbound UnboundOp{} = True
+is_unbound _ = False
ppr_opfix :: (OpName, Fixity) -> SDoc
ppr_opfix (op, fixity) = pp_op <+> brackets (ppr fixity)
diff --git a/testsuite/tests/rename/should_fail/T13947.hs b/testsuite/tests/rename/should_fail/T13947.hs
new file mode 100644
index 0000000..bc435e7
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T13947.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeOperators #-}
+module T13947 where
+
+f :: () -> Int :~: Int
+f = undefined
diff --git a/testsuite/tests/rename/should_fail/T13947.stderr b/testsuite/tests/rename/should_fail/T13947.stderr
new file mode 100644
index 0000000..8a636a2
--- /dev/null
+++ b/testsuite/tests/rename/should_fail/T13947.stderr
@@ -0,0 +1,3 @@
+
+T13947.hs:4:12: error:
+ Not in scope: type constructor or class ‘:~:’
diff --git a/testsuite/tests/rename/should_fail/all.T b/testsuite/tests/rename/should_fail/all.T
index 9acd5b8..37d42d7 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -126,3 +126,4 @@ test('T12686', normal, compile_fail, [''])
test('T11592', normal, compile_fail, [''])
test('T12879', normal, compile_fail, [''])
test('T13568', normal, multimod_compile_fail, ['T13568','-v0'])
+test('T13947', normal, compile_fail, [''])
More information about the ghc-commits
mailing list