Define a primitive data type
Here the result 11 fails to smartmatch against the range 1..10
, so the second assignment throws an exception. You may use any valid smartmatch predicate within a where
clause, so the following one-argument closure is also legal:
Last updated