From 093c281ea93ef4bfa4b6975f6b6129713ee0dbd7 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Thu, 7 May 2026 22:53:59 +0200 Subject: [PATCH] Working match --- test/src/main.mist | 7 ++++++- test/src/my_class.mist | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/src/main.mist b/test/src/main.mist index 43b0343..13cc58e 100644 --- a/test/src/main.mist +++ b/test/src/main.mist @@ -6,5 +6,10 @@ void main() { var my_class = new MyClass("World"); my_class.greet(); - match (MyEnum::Tuple(10)) {} + match (MyEnum::Tuple(10, String::new())) { + MyEnum::Tuple(i, _) => { + println!("{i}"); + } + _ => {} + } } diff --git a/test/src/my_class.mist b/test/src/my_class.mist index 0c31846..7927688 100644 --- a/test/src/my_class.mist +++ b/test/src/my_class.mist @@ -10,7 +10,7 @@ class MyClass { } } -enum MyEnum { +public enum MyEnum { Named, Tuple(i32, String), Struct { i32 x }