FS0748 error "This construct may only be used in computation expresions" reported for 'return' when it is not true
- Dominant language
- F#
- Stars
- 4.3k
- Forks
- 876
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 131
Description
I knew I was testing potentially invalid code, but I was surprised to see the error:

Or in text for googleability:
> FS0748: This construct may only be used within computation expressions. To return a value from an ordinaty function simply write the expression without 'return'.
### Repro steps
Use something like `return 1, return 2` at the end of any computation expression.
### Expected behavior
Some syntax error, but not the one mentioned above.
### Actual behavior
Error FS0748 as mentioned is reported, but the error says I am not inside a computation expression, while I am.
### Known workarounds
Don't listen to the error, but fix your code ;).
### Related information
As an aside (as always): it would be interesting to here thoughts on allowing `return x, return y`, but I'm not sure if we can get the behavior defined cleanly. My expectation would be that it would return a tuple of two instances of the computation expression.
* Seen in VS 15.6 and 15.7, but likely the same in any recent version.
Contributor guide
Assessment
This issue has not been assessed yet.