From b48444ae76e86e9dbab52a38221ba4a4ed23b961 Mon Sep 17 00:00:00 2001 From: Lukasz Czajka Date: Sun, 10 Dec 2023 11:26:03 +0100 Subject: [PATCH] bugfix --- src/Juvix/Compiler/Asm/Pretty/Base.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Juvix/Compiler/Asm/Pretty/Base.hs b/src/Juvix/Compiler/Asm/Pretty/Base.hs index 1b2a8c5fcf..d5cb94cf10 100644 --- a/src/Juvix/Compiler/Asm/Pretty/Base.hs +++ b/src/Juvix/Compiler/Asm/Pretty/Base.hs @@ -350,10 +350,10 @@ instance (PrettyCode a) => PrettyCode [a] where instance PrettyCode FunctionInfo where ppCode FunctionInfo {..} = do - argtys <- mapM ppCode (typeArgs _functionType) + argtys <- mapM ppCode (take _functionArgsNum (typeArgs _functionType)) let argnames = map (fmap variable) _functionArgNames args = zipWithExact (\mn ty -> maybe mempty (\n -> n <+> colon <> space) mn <> ty) argnames argtys - targetty <- ppCode (typeTarget _functionType) + targetty <- ppCode (if _functionArgsNum == 0 then _functionType else typeTarget _functionType) c <- ppCodeCode _functionCode return $ keyword Str.function