I know there's a concept of flow-sensitive typing in Ceylon in which we can narrow down the type of an expression by case. Is there a way to explicitly convert the type of an expression in Ceylon as in Java?
I know there's a concept of flow-sensitive typing in Ceylon in which we can narrow down the type of an expression by case. Is there a way to explicitly convert the type of an expression in Ceylon as in Java?
As a statement:
assert(variable is NarrowType);
I don’t remember if there’s a recommended way to do that as an expression, but you could always put the above (plus return variable;) into a generic function and call it with your expression