diff --git a/src/Core/OpenResolve.hs b/src/Core/OpenResolve.hs index 16d2f9c2f..8440900f1 100644 --- a/src/Core/OpenResolve.hs +++ b/src/Core/OpenResolve.hs @@ -177,21 +177,21 @@ resOpen (Env penv gamma) eopen effFrom effTo tpFrom tpTo@(TFun targs _ tres) exp if (isHandlerFree expr) then trace ("*** remove open-none") $ -- fully total with using any operations that need evidence; just leave it as is expr - else if (n <= 6) + else if (n <= 2) then wrapper (resolve (nameOpenNone n)) [] -- fails in perf1c with exceeded stack size if --optmaxdup < 500 (since it prevents a tailcall) -- expr -- fails in nim as it evidence is not cleared else wrapperThunk (resolve (nameOpenNone 0)) [] [l] -> -- just one: used open-atN for efficiency trace (" one handled effect; use at: " ++ show (ppType penv l)) $ - if (n <= 6) + if (n <= 2) then wrapper (resolve (nameOpenAt n)) [evIndexOf l] else wrapperThunk (resolve (nameOpenAt 0)) [evIndexOf l] _ -> --failure $ "Core.OpenResolve.resOpen: todo: from: " ++ show (ppType penv effFrom) ++ ", to " ++ show (ppType penv effTo) -- ++ " with handled: " ++ show (map (ppType penv) lsFrom, map (ppType penv) lsTo) let indices = makeVector typeEvIndex (map evIndexOf lsFrom) - in if (n <= 6) + in if (n <= 2) then wrapper (resolve (nameOpen n)) [indices] else wrapperThunk (resolve (nameOpen 0)) [indices] diff --git a/test/algeff/open-clauses.kk b/test/algeff/open-clauses.kk deleted file mode 100644 index a960aa0e8..000000000 --- a/test/algeff/open-clauses.kk +++ /dev/null @@ -1,27 +0,0 @@ -effect xeff - fun doA(a: int, b: int, c: int, d: int, e: int, f: int): string - fun doB(a: int, b: int, c: int, d: int, e: int): string - fun doC(a: int, b: int, c: int, d: int): string - fun doD(a: int, b: int, c: int): string - fun doE(a: int, b: int): string - fun doF(a: int): string - fun doG(): string - -fun main() - with handler - fun doA(a, b, c, d, e, f) - [a, b, c, d, e, f].show - fun doB(a, b, c, d, e) - [a, b, c, d, e].show - fun doC(a, b, c, d) - [a, b, c, d].show - fun doD(a, b, c) - [a, b, c].show - fun doE(a, b) - "(" ++ show(a) ++ ", " ++ show(b) ++ ")" - fun doF(a) - a.show - fun doG() - "G" - val result = doA(1, 2, 3, 4, 5, 6) ++ doB(7, 8, 9, 10, 11) ++ doC(12, 13, 14, 15) ++ doD(16, 17, 18) ++ doE(19, 20) ++ doF(21) ++ doG() - result.println \ No newline at end of file