Multiple type cases for match in

This commit is contained in:
Ginger Bill
2017-03-19 20:55:39 +00:00
parent c34d839f9f
commit c26990c22d
5 changed files with 193 additions and 188 deletions

View File

@@ -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;