From c26990c22daf6d2e09948b38366f457496f16cfe Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 19 Mar 2017 20:55:39 +0000 Subject: Multiple type cases for `match in` --- code/demo.odin | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'code') diff --git a/code/demo.odin b/code/demo.odin index 70f50c388..86a132142 100644 --- a/code/demo.odin +++ b/code/demo.odin @@ -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; -- cgit v1.2.3