Fix #13947 by checking for unbounded names more
authorRyan Scott <ryan.gl.scott@gmail.com>
Tue, 11 Jul 2017 17:59:29 +0000 (13:59 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 11 Jul 2017 18:36:04 +0000 (14:36 -0400)
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

compiler/rename/RnTypes.hs
testsuite/tests/rename/should_fail/T13947.hs [new file with mode: 0644]
testsuite/tests/rename/should_fail/T13947.stderr [new file with mode: 0644]
testsuite/tests/rename/should_fail/all.T

index 35b67a2..014d485 100644 (file)
@@ -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 (file)
index 0000000..bc435e7
--- /dev/null
@@ -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 (file)
index 0000000..8a636a2
--- /dev/null
@@ -0,0 +1,3 @@
+
+T13947.hs:4:12: error:
+    Not in scope: type constructor or class ‘:~:’
index 457f401..f7f7719 100644 (file)
@@ -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, [''])