From: Matthijs Kooijman Date: Thu, 9 Apr 2009 16:03:13 +0000 (+0200) Subject: Allow references to global values without arguments. X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Fc%CE%BBash.git;a=commitdiff_plain;h=cba9bc73cb53261fd0a60dc90b3b470e541de608 Allow references to global values without arguments. These references are treated as function applications without arguments. --- diff --git a/Flatten.hs b/Flatten.hs index d38443b..8d2d5b6 100644 --- a/Flatten.hs +++ b/Flatten.hs @@ -170,6 +170,9 @@ flattenExpr binds var@(Var id) = addNameHint (Name.getOccString id) sig_id addDef (UncondDef (Right $ Literal lit) sig_id) return ([], Single sig_id) + IdInfo.VanillaGlobal -> + -- Treat references to globals as an application with zero elements + flattenApplicationExpr binds (CoreUtils.exprType var) id [] otherwise -> error $ "Ids other than local vars and dataconstructors not supported: " ++ (showSDoc $ ppr id)