[commit: ghc] master: Fix #13947 by checking for unbounded names more (85ac65c)
git at git.haskell.org
git at git.haskell.org
Tue Jul 11 18:36:34 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/85ac65c5f0b057f1b07ed7bf9a8d9aeae4ce1390/ghc
>---------------------------------------------------------------
commit 85ac65c5f0b057f1b07ed7bf9a8d9aeae4ce1390
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
>---------------------------------------------------------------
85ac65c5f0b057f1b07ed7bf9a8d9aeae4ce1390
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 35b67a2..014d485 100644
--- a/compiler/rename/RnTypes.hs
+++ b/compiler/rename/RnTypes.hs
@@ -1431,8 +1431,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 457f401..f7f7719 100644
--- a/testsuite/tests/rename/should_fail/all.T
+++ b/testsuite/tests/rename/should_fail/all.T
@@ -127,3 +127,4 @@ test('T11592', normal, compile_fail, [''])
test('T12879', normal, compile_fail, [''])
test('T13644', expect_broken(13644), multimod_compile_fail, ['T13644','-v0'])
test('T13568', normal, multimod_compile_fail, ['T13568','-v0'])
+test('T13947', normal, compile_fail, [''])
More information about the ghc-commits
mailing list