Bug #299 doesn't seem to depend on lambdas actually...

This commit is contained in:
Erik Svedäng 2018-09-25 16:44:07 +02:00
parent 9c9911c542
commit 83314ec9d9

View File

@ -76,13 +76,12 @@ concretizeXObj allowAmbiguityRoot typeEnv rootEnv visitedDefinitions root =
return [defn, nameSymbol, args, okBody]
-- | Fn / λ
visitList allowAmbig env fn@(XObj (Lst [(XObj (Fn _ _) fni fnt), args@(XObj (Arr argsArr) ai at), body]) i t) =
visitList allowAmbig env (XObj (Lst [(XObj (Fn _ _) fni fnt), args@(XObj (Arr argsArr) ai at), body]) i t) =
-- The basic idea of this function is to first visit the body of the lambda ("in place"),
-- then take the resulting body and put into a separate function 'defn' with a new name
-- in the global scope. That function definition will be set as the lambdas '.callback' in
-- the C code.
do mapM_ (concretizeTypeOfXObj typeEnv) argsArr
concretizeTypeOfXObj typeEnv fn
let Just ii = i
Just funcTy = t
-- | TODO: This code is a copy of the one above in Defn, remove duplication: