From fedb895ce8a77961413f2e6bd1bbcbeb92f1191f Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Sun, 1 Dec 2024 12:10:04 +0100 Subject: [PATCH] inline only fully applied --- src/Juvix/Compiler/Core/Transformation/Optimize/Inlining.hs | 1 + tests/Compilation/positive/test086.juvix | 1 + 2 files changed, 2 insertions(+) diff --git a/src/Juvix/Compiler/Core/Transformation/Optimize/Inlining.hs b/src/Juvix/Compiler/Core/Transformation/Optimize/Inlining.hs index 37dde9ef84..097c627f1a 100644 --- a/src/Juvix/Compiler/Core/Transformation/Optimize/Inlining.hs +++ b/src/Juvix/Compiler/Core/Transformation/Optimize/Inlining.hs @@ -61,6 +61,7 @@ convertNode inlineDepth nonRecSyms symOcc md = dmapL go Just InlineNever -> node _ | HashSet.member _identSymbol nonRecSyms + && argsNum == 0 && ( HashMap.lookup _identSymbol symOcc == Just 1 || isImmediate md def ) -> diff --git a/tests/Compilation/positive/test086.juvix b/tests/Compilation/positive/test086.juvix index 63094d7e15..ec261fc5cd 100644 --- a/tests/Compilation/positive/test086.juvix +++ b/tests/Compilation/positive/test086.juvix @@ -1,3 +1,4 @@ +-- Patterns in definitions module test086; import Stdlib.Prelude open;