Created
February 19, 2017 11:52
-
-
Save LefterisJP/f3ce8a2a1f7b69d7f58ecd1fe4b40122 to your computer and use it in GitHub Desktop.
demo.rf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type foo {a:i32 | b:string } | |
fn main()->u32{ | |
t1:foo = foo(29) | |
t2:foo = foo("hello") | |
r:i32 = match t1 { | |
a:i32 => a | |
_ => 0 | |
} | |
s:string = match t2 { | |
b:string => b | |
_ => "" | |
} | |
print(s) | |
return r | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment