[commit: ghc] no-pred-ty: Remove the "Ghastly special case" from dataTcOccs (b98267a)

Max Bolingbroke batterseapower at hotmail.com
Tue Sep 6 18:27:24 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : no-pred-ty

http://hackage.haskell.org/trac/ghc/changeset/b98267adc04266e0001019fb17746be570cc79ae

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

commit b98267adc04266e0001019fb17746be570cc79ae
Author: Max Bolingbroke <batterseapower at hotmail.com>
Date:   Fri Sep 2 19:23:56 2011 +0100

    Remove the "Ghastly special case" from dataTcOccs
    
    This special case was introduced in 228c4743 to
    'Fix problem with :i for (:)' but the associated Note
    doesn't explain why (:) deserves this treatment but not
    e.g. Left and Right.
    
    Removing the special case does not break anything
    (including :i (:)) so I guess this is no longer necessary.
    
    Conflicts:
    
    	compiler/rename/RnEnv.lhs

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

 compiler/rename/RnEnv.lhs |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs
index cf37499..8faf6e3 100644
--- a/compiler/rename/RnEnv.lhs
+++ b/compiler/rename/RnEnv.lhs
@@ -50,9 +50,7 @@ import NameEnv
 import Module           ( ModuleName, moduleName )
 import UniqFM
 import DataCon		( dataConFieldLabels )
-import PrelNames        ( mkUnboundName, rOOT_MAIN, consDataConKey, forall_tv_RDR )
-import Unique
-import BasicTypes
+import PrelNames        ( mkUnboundName, rOOT_MAIN, forall_tv_RDR )
 import ErrUtils		( Message )
 import SrcLoc
 import Outputable
@@ -675,21 +673,11 @@ dataTcOccs :: RdrName -> [RdrName]
 -- constructor.  This is useful when we aren't sure which we are
 -- looking at.
 dataTcOccs rdr_name
-  | Just n <- isExact_maybe rdr_name		-- Ghastly special case
-  , n `hasKey` consDataConKey = [rdr_name]	-- see note below
   | isDataOcc occ 	      = [rdr_name, rdr_name_tc]
   | otherwise 	  	      = [rdr_name]
   where    
     occ 	= rdrNameOcc rdr_name
     rdr_name_tc = setRdrNameSpace rdr_name tcName
-
--- If the user typed "[]" or "(,,)", we'll generate an Exact RdrName,
--- and setRdrNameSpace generates an Orig, which is fine
--- But it's not fine for (:), because there *is* no corresponding type
--- constructor.  If we generate an Orig tycon for GHC.Base.(:), it'll
--- appear to be in scope (because Orig's simply allocate a new name-cache
--- entry) and then we get an error when we use dataTcOccs in 
--- TcRnDriver.tcRnGetInfo.  Large sigh.
 \end{code}
 
 





More information about the Cvs-ghc mailing list