You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
justinmann edited this page Dec 24, 2017
·
1 revision
This is special if statement that can check if an option is valid and if so allow you to access the underlying object inside the block.
a : empty'i32
b : ifValid a {
a
} elseEmpty {
-1
}
class(
x : empty'i32
) { this }
c : class(valid(5))
d : ifValid bob : c?.x {
// bob will point to the value in c.x if it has a value
}