Wibble to "Fix a long-standing bug in HsUtils.hsTyClDeclBinders"
authorSimon Peyton Jones <simonpj@microsoft.com>
Fri, 5 Aug 2011 16:40:29 +0000 (17:40 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 5 Aug 2011 16:40:29 +0000 (17:40 +0100)
compiler/rename/RnNames.lhs

index 557cdad..d58db09 100644 (file)
@@ -581,8 +581,9 @@ get_local_binders gbl_env (HsGroup {hs_valds  = ValBindsIn _ val_sigs,
              ; return (AvailTC main_name names) }
 
     new_ti local_tc_env ti_decl  -- ONLY for type/data instances
-        = do { let tc_rdr = tcdName (unLoc ti_decl)
-             ; main_name <- case lookupOccEnv local_tc_env (rdrNameOcc tc_rdr) of
+        = do { let L loc tc_rdr = tcdLName (unLoc ti_decl)
+             ; main_name <- setSrcSpan loc $
+                            case lookupOccEnv local_tc_env (rdrNameOcc tc_rdr) of
                               Nothing -> lookupGlobalOccRn tc_rdr
                               Just n  -> return n
                    -- See Note [Looking up family names in family instances]