From a867dbc7975f56784b24410dbcbf5bec5f68a73b Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Sun, 28 Jun 2026 06:04:39 +0200 Subject: [PATCH] Fixed codegen for function type --- crates/codegen/src/lib.rs | 6 +++--- mist-test/src/main.mist | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index 064e822..3e0610a 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -268,14 +268,14 @@ impl GetRust for TypeExpr { params, } => { format!( - "{} -> {}({})", + "{}({}) -> {}", kind.get_rust(), - return_type.get_rust(), params .iter() .map(TypeExpr::get_rust) .collect::>() - .join(", ") + .join(", "), + return_type.get_rust(), ) } } diff --git a/mist-test/src/main.mist b/mist-test/src/main.mist index 689fc94..e5fd2e4 100644 --- a/mist-test/src/main.mist +++ b/mist-test/src/main.mist @@ -15,6 +15,4 @@ void main() items::impl_test::run_tests(); items::attribute_test::run_tests(); println!("\x1b[32m\nAll tests passed!\x1b[0m"); - - void fn() hello = () => {}; }