From f6c8cfd4faf6b202fb128054a2c56c7c842be77b Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 20 Mar 2003 12:20:06 +0000 Subject: [PATCH] [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. --- ghc/compiler/basicTypes/Id.lhs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 -- 1.7.10.4