Skip to content

Instantly share code, notes, and snippets.

@LefterisJP
Created February 19, 2017 11:52
Show Gist options
  • Save LefterisJP/f3ce8a2a1f7b69d7f58ecd1fe4b40122 to your computer and use it in GitHub Desktop.
Save LefterisJP/f3ce8a2a1f7b69d7f58ecd1fe4b40122 to your computer and use it in GitHub Desktop.
demo.rf
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