Enhancements for the Range support #6132
-
Currently, when we use Range with an expression, we would get an error likes Could we make it more simple to use, wondering if it's possible to let the range operator |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Just add a brace: See docs: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/#operator-precedence Picture: |
Beta Was this translation helpful? Give feedback.
-
What is the suggested solution? Since changing the precedence would be a breaking change, I don't think it's likely that code like |
Beta Was this translation helpful? Give feedback.
-
The precedence of |
Beta Was this translation helpful? Give feedback.
Just add a brace:
(i + 1)..
See docs:
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/#operator-precedence
Picture: