This piece code here:
1 2 3 |
|
throws exception:
Cannot convert the expression's type 'Boolean' to type 'Void'
It is because if the block does not have a return statement, the compiler uses the result of the last statement as the return value
Adding a return ()
as the last expression to the block fixes the problem