Ticket #7145: 7145.patch

File 7145.patch, 1.3 KB (added by pcapriotti, 3 years ago)
  • compiler/rename/RnNames.lhs

    From 6277c9758bcdba7f3cf7b33cbce086e4da4b8701 Mon Sep 17 00:00:00 2001
    From: Paolo Capriotti <[email protected]>
    Date: Tue, 14 Aug 2012 16:14:41 +0100
    Subject: [PATCH] Ensure exported constructors are marked as used (#7145)
    
    Entities of the form C(a, b) in an export list should count as usages of
    constructors/methods a and b.
    ---
     compiler/rename/RnNames.lhs |    4 +++-
     1 file changed, 3 insertions(+), 1 deletion(-)
    
    diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs
    index 22d7554..c365046 100644
    a b exports_from_avail (Just rdr_items) rdr_env imports this_mod 
    10651065             if any isNothing mb_names 
    10661066                then do addErr (exportItemErr ie) 
    10671067                        return (IEThingWith name [], AvailTC name [name]) 
    1068                 else do let names = catMaybes mb_names 
     1068                else do -- only mark names as used if the parent is unqualified 
     1069                        when (isUnqual rdr) (addUsedRdrNames sub_rdrs) 
     1070                        let names = catMaybes mb_names 
    10691071                        optTyFam <- xoptM Opt_TypeFamilies 
    10701072                        when (not optTyFam && any isTyConName names) $ 
    10711073                          addErr (typeItemErr ( head