diff options
author | Max Bolingbroke <batterseapower@hotmail.com> | 2011-09-02 19:23:56 +0100 |
---|---|---|
committer | Max Bolingbroke <batterseapower@hotmail.com> | 2011-09-06 17:21:09 +0100 |
commit | b98267adc04266e0001019fb17746be570cc79ae (patch) | |
tree | 21bd916c3226bc682ef879487897a17c0414d616 /compiler/rename | |
parent | c02ff7c735447a6e76ac2e372b22ebc9d87c56dc (diff) | |
download | haskell-b98267adc04266e0001019fb17746be570cc79ae.tar.gz |
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
Diffstat (limited to 'compiler/rename')
-rw-r--r-- | 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 cf37499590..8faf6e3eb0 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} |