From d4ed513986d700d77ba4b7c365d80213b03537bb Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 26 Aug 2024 19:03:40 -0700 Subject: [PATCH] temp --- src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs index 071fc474a188..74ee68565e28 100644 --- a/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs +++ b/src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs @@ -194,12 +194,10 @@ module Pass1_DetermineTLRAndArities = let nFormals = vss.Length let nMaxApplied = GetMaxNumArgsAtUses xinfo f let arity = Operators.min nFormals nMaxApplied - if atTopLevel then - Some (f, arity) - else if arity<>0 || not (isNil tps) then - Some (f, arity) - else - None + if atTopLevel then Some (f, arity) + elif g.realsig && arity > 0 then None // This needs some investigation I sorta understand but would have a hard time explaining it + elif arity<>0 || not (isNil tps) then Some (f, arity) + else None /// Check if f involves any value recursion (so can skip those). /// ValRec considered: recursive && some f in mutual binding is not bound to a lambda