From 0c56ef64fc1daa4b6d313ef69b93a48c9dadaccf Mon Sep 17 00:00:00 2001 From: simonpj Date: Wed, 12 Feb 2003 17:57:34 +0000 Subject: [PATCH 1/1] [project @ 2003-02-12 17:57:34 by simonpj] A wibble to the constructor-naming story --- ghc/compiler/ghci/ByteCodeGen.lhs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ghc/compiler/ghci/ByteCodeGen.lhs b/ghc/compiler/ghci/ByteCodeGen.lhs index 367326e..b8cbb37 100644 --- a/ghc/compiler/ghci/ByteCodeGen.lhs +++ b/ghc/compiler/ghci/ByteCodeGen.lhs @@ -30,7 +30,7 @@ import CoreFVs ( freeVars ) import Type ( typePrimRep, isUnLiftedType, splitTyConApp_maybe, isTyVarTy ) import DataCon ( DataCon, dataConTag, fIRST_TAG, dataConTyCon, - isUnboxedTupleCon, isNullaryDataCon, + isUnboxedTupleCon, isNullaryDataCon, dataConWorkId, dataConRepArity ) import TyCon ( tyConFamilySize, isDataTyCon, tyConDataCons, isFunTyCon, isUnboxedTupleTyCon ) @@ -242,9 +242,9 @@ schemeTopBind (id, rhs) | Just data_con <- isDataConWorkId_maybe id, isNullaryDataCon data_con = -- Special case for the worker of a nullary data con. - -- It'll look like this: $wNil = /\a -> $wNil a + -- It'll look like this: Nil = /\a -> Nil a -- If we feed it into schemeR, we'll get - -- $wNil = $wNil + -- Nil = Nil -- because mkConAppCode treats nullary constructor applications -- by just re-using the single top-level definition. So -- for the worker itself, we must allocate it directly. @@ -569,7 +569,7 @@ mkConAppCode :: Int -> Sequel -> BCEnv mkConAppCode orig_d s p con [] -- Nullary constructor = ASSERT( isNullaryDataCon con ) - returnBc (unitOL (PUSH_G (getName con))) + returnBc (unitOL (PUSH_G (getName (dataConWorkId con)))) -- Instead of doing a PACK, which would allocate a fresh -- copy of this constructor, use the single shared version. -- 1.7.10.4