From cac497a560bcd33fd1e43c177b0f8303764f486a Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Fri, 5 Jun 2026 17:39:41 +0200 Subject: [PATCH] Fixed type bugs #65 --- crates/codegen/src/lib.rs | 2 +- crates/parser/src/parser/common/types.rs | 5 +++++ mist-test/src/main.mist | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index 770acd2..168b0af 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -205,7 +205,7 @@ impl GetRust for TypeExpr { let mutable = if *mutable { "mut " } else { "" }; if let Some(lifetime) = lifetime { - format!("&{}{mutable}{}", lifetime.get_rust(), ty.get_rust()) + format!("&'{} {mutable}{}", lifetime.get_rust(), ty.get_rust()) } else { format!("&{mutable}{}", ty.get_rust()) } diff --git a/crates/parser/src/parser/common/types.rs b/crates/parser/src/parser/common/types.rs index aa3307f..fc610f0 100644 --- a/crates/parser/src/parser/common/types.rs +++ b/crates/parser/src/parser/common/types.rs @@ -36,6 +36,11 @@ impl<'a> TryFrom> for TypeExpr { ty: TypeExpr::try_from(inner.next().unwrap()).map(Box::new), }) } + Rule::dyn_type => { + ast_expr!(TypeExpr::Dyn( + TypeExpr::try_from(inner.next().unwrap()).map(Box::new), + )) + } _ => AstError::bug_unimplemented(pair), } diff --git a/mist-test/src/main.mist b/mist-test/src/main.mist index d8b71aa..05a37e9 100644 --- a/mist-test/src/main.mist +++ b/mist-test/src/main.mist @@ -1 +1 @@ -*void main() {} \ No newline at end of file +void main() {} \ No newline at end of file