[commit: ghc] wip/names3: TcRnDriver: Use span from real thing in boot decl conflict error (d0a7338)

git at git.haskell.org git at git.haskell.org
Tue Sep 13 15:07:03 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/names3
Link       : http://ghc.haskell.org/trac/ghc/changeset/d0a733803a614d2590b5b0520000b8a4dab05af0/ghc

>---------------------------------------------------------------

commit d0a733803a614d2590b5b0520000b8a4dab05af0
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Mon Sep 12 16:18:08 2016 -0400

    TcRnDriver: Use span from real thing in boot decl conflict error


>---------------------------------------------------------------

d0a733803a614d2590b5b0520000b8a4dab05af0
 compiler/typecheck/TcRnDriver.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcRnDriver.hs b/compiler/typecheck/TcRnDriver.hs
index bd32d80..0d9dcd0 100644
--- a/compiler/typecheck/TcRnDriver.hs
+++ b/compiler/typecheck/TcRnDriver.hs
@@ -898,7 +898,9 @@ checkBootDeclM :: Bool  -- ^ True <=> an hs-boot file (could also be a sig)
                -> TyThing -> TyThing -> TcM ()
 checkBootDeclM is_boot boot_thing real_thing
   = whenIsJust (checkBootDecl boot_thing real_thing) $ \ err ->
-       addErrAt (nameSrcSpan (getName boot_thing))
+       -- Here we use the source span of the real thing since the boot_thing may
+       -- have come from an interface file and therefore may not have a span
+       addErrAt (nameSrcSpan (getName real_thing))
                 (bootMisMatch is_boot err real_thing boot_thing)
 
 -- | Compares the two things for equivalence between boot-file and normal



More information about the ghc-commits mailing list