Multiple type cases for match in
This commit is contained in:
1 parent
c34d839f9f
commit
c26990c22d
5 files changed
+193
-188
No files matched your search
@@ -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