Commit ed20412a authored by Alex D's avatar Alex D 🍄 Committed by Marge Bot

Do not report error if Name in pragma is unbound

parent 13572480
Pipeline #6762 passed with stages
in 398 minutes and 31 seconds
......@@ -68,6 +68,7 @@ import PrelNames ( rOOT_MAIN )
import BasicTypes ( pprWarningTxtForMsg, TopLevelFlag(..))
import SrcLoc
import Outputable
import UniqSet ( uniqSetAny )
import Util
import Maybes
import DynFlags
......@@ -1462,7 +1463,9 @@ lookupBindGroupOcc ctxt what rdr_name
RoleAnnotCtxt ns -> lookup_top (`elemNameSet` ns)
LocalBindCtxt ns -> lookup_group ns
ClsDeclCtxt cls -> lookup_cls_op cls
InstDeclCtxt ns -> lookup_top (`elemNameSet` ns)
InstDeclCtxt ns -> if uniqSetAny isUnboundName ns -- #16610
then return (Right $ mkUnboundNameRdr rdr_name)
else lookup_top (`elemNameSet` ns)
where
lookup_cls_op cls
= lookupSubBndrOcc True cls doc rdr_name
......
module T16610 where
data Foo = Foo
instance Eq Foo where
{-# INLINE wrong #-}
wrong _ = True
T16610.hs:6:3: error:
‘wrong’ is not a (visible) method of class ‘Eq’
......@@ -150,3 +150,4 @@ test('T15957_Fail', normal, compile_fail, ['-Werror -Wall -Wno-missing-signature
test('T16385', normal, compile_fail, [''])
test('T16504', normal, compile_fail, [''])
test('T14548', normal, compile_fail, [''])
test('T16610', normal, compile_fail, [''])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment