[commit: ghc] : Handle nullary Cons in myCollectArgs (4068e40)

git at git.haskell.org git at git.haskell.org
Mon Oct 10 21:43:23 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : 
Link       : http://ghc.haskell.org/trac/ghc/changeset/4068e403fe104e4226939190bb107a1f3c655d0c/ghc

>---------------------------------------------------------------

commit 4068e403fe104e4226939190bb107a1f3c655d0c
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Sun Oct 9 12:38:14 2016 -0400

    Handle nullary Cons in myCollectArgs


>---------------------------------------------------------------

4068e403fe104e4226939190bb107a1f3c655d0c
 compiler/stgSyn/CoreToStg.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/compiler/stgSyn/CoreToStg.hs b/compiler/stgSyn/CoreToStg.hs
index 1f9cf15..5a8ce94 100644
--- a/compiler/stgSyn/CoreToStg.hs
+++ b/compiler/stgSyn/CoreToStg.hs
@@ -1058,6 +1058,8 @@ myCollectArgs expr
   where
     go (Var v)          as ts = (v, as, ts)
     go (App f a)        as ts = go f (a:as) ts
+    go (ConApp dc args) as ts = ASSERT( all isTypeArg as && all isTypeArg args )
+                                (dataConWorkId dc, [], ts)
     go (Tick t e)       as ts = ASSERT( all isTypeArg as )
                                 go e as (t:ts) -- ticks can appear in type apps
     go (Cast e _)       as ts = go e as ts
@@ -1070,6 +1072,10 @@ myCollectArgs expr
 --
 -- This big-lambda case occurred following a rather obscure eta expansion.
 -- It all seems a bit yukky to me.
+--
+-- It can happen more often now with saturated constructor applications, where
+--    (\ (@a) -> [] [@a]) @Type
+-- can happen.
 
 stgArity :: Id -> HowBound -> Arity
 stgArity _ (LetBound _ arity) = arity



More information about the ghc-commits mailing list