From: simonpj Date: Thu, 20 Mar 2003 12:20:06 +0000 (+0000) Subject: [project @ 2003-03-20 12:20:06 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1058 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f6c8cfd4faf6b202fb128054a2c56c7c842be77b;p=ghc-hetmet.git [project @ 2003-03-20 12:20:06 by simonpj] ---------------------------------- Fix a long-standing egregious CorePrep bug ---------------------------------- **** Merge to Stable branch **** CorePrep was eta-reducing \x -> (# a,x #) to (#,#) a which is utterly wrong. Easily fixed though. --- diff --git a/ghc/compiler/basicTypes/Id.lhs b/ghc/compiler/basicTypes/Id.lhs index 42aa3d1..949ed23 100644 --- a/ghc/compiler/basicTypes/Id.lhs +++ b/ghc/compiler/basicTypes/Id.lhs @@ -96,6 +96,7 @@ import Type ( Type, typePrimRep, addFreeTyVars, import IdInfo import qualified Demand ( Demand ) +import DataCon ( isUnboxedTupleCon ) import NewDemand ( Demand, StrictSig, topDmd, topSig, isBottomingSig ) import Name ( Name, OccName, mkSystemName, mkSystemNameEncoded, mkInternalName, @@ -276,11 +277,13 @@ isDataConWrapId id = case globalIdDetails id of -- binding, even though it is defined in this module. -- Data constructor workers used to be things of this kind, but -- they aren't any more. Instead, we inject a binding for --- them at the CorePrep stage. +-- them at the CorePrep stage. +-- EXCEPT: unboxed tuples, which definitely have no binding hasNoBinding id = case globalIdDetails id of - PrimOpId _ -> True - FCallId _ -> True - other -> False + PrimOpId _ -> True + FCallId _ -> True + DataConWorkId dc -> isUnboxedTupleCon dc + other -> False isImplicitId :: Id -> Bool -- isImplicitId tells whether an Id's info is implied by other