mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Multiple type cases for match in
This commit is contained in:
@@ -68,6 +68,21 @@ main :: proc() {
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
t := type_info(int);
|
||||
using Type_Info;
|
||||
match i in t {
|
||||
case Integer, Float:
|
||||
fmt.println("It's a number");
|
||||
}
|
||||
|
||||
x: any = 123;
|
||||
match i in x {
|
||||
case int, f32:
|
||||
fmt.println("It's an int or f32");
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
cond := true;
|
||||
x: int;
|
||||
|
||||
Reference in New Issue
Block a user