Open nothrow opened 1 year ago
Still present on net 8 RC1. Adding parentheses solves the problem but it still looks like a bug to me.
I just ran into this. The compiler errors cause massive debugging headaches, I was only able to find this to be the culprit after a lot of trial and error.
I thought the razor compiler was supposed to be getting better? Needing to wrap my patterns in parentheses is pretty lame when it's perfectly valid c# syntax without them. :(
Is there an existing issue for this?
Describe the bug
Using
expr switch { <0 => something }
statement with ranges inside@code{}
does not compile. the<
character in switch apparently confuses tokenizer. using regularswitch expr { case <0: return something; }
works.Expected Behavior
I'd expect the page to compile
Steps To Reproduce
Exceptions (if any)
.NET Version
7.0.200
Anything else?
ASP.NET Core version: 7.0.3