aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-03-19 20:55:39 +0000
committerGinger Bill <bill@gingerbill.org>2017-03-19 20:55:39 +0000
commitc26990c22daf6d2e09948b38366f457496f16cfe (patch)
treeec7ffec4193ffb90fe4e18b3b2bcc41eec537770 /code
parentc34d839f9ffd110762270f071d7abbefaa41bc20 (diff)
Multiple type cases for `match in`
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin15
1 files changed, 15 insertions, 0 deletions
diff --git a/code/demo.odin b/code/demo.odin
index 70f50c388..86a132142 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -69,6 +69,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;
if cond {