>From some playing around with it, I think that the entire case structure needs 
>to be an expression, rather than a mix of statements and expressions.

eg, an echo statement anywhere in there seems to cause problems.

However, something that does seem to work is to call a function which returns 
the expected type; and then inside that function, do the echoing.

I think though that what you're trying to do should be valid, according to the 
docs:

[https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression](https://nim-lang.org/docs/manual.html#statements-and-expressions-case-expression)

Not sure, but I think it's a compiler bug.

Reply via email to