[Blazor] Semi-colon inside @() raises syntax errors
Open
Area-Razor
Area-Razor-Compiler
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Describe the bug
Inside a razor page:
```razor
foo
```
This works as expected.
```razor
bar
```
This raises CS0116 and CS0115 errors.
I don't know if this is intended behaviour, but the errors thrown aren't very indicative of the error at hand.
### Expected Behavior
Not entirely sure, either a better error message or for it to compile properly.
### Steps To Reproduce
See description above.
### Exceptions (if any)
CS0115, CS0116
### .NET Version
8.0.302
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.