It's a bit of an obscure edge case, but we managed to hit it in the NuGet Gallery :). Run the attached page as a Razor v2 page.
EXPECTED: Renders a text box saying "hihihihihihi..." (repeated 10 times)
ACTUAL: CS1002: ; expected
There is a workaround: Just take the value you are generating in the conditional attribute and calculate it in a variable, then render the variable inside the conditional attribute.
Comments: My own note, this was a regression between Razor v1 and v2.
EXPECTED: Renders a text box saying "hihihihihihi..." (repeated 10 times)
ACTUAL: CS1002: ; expected
There is a workaround: Just take the value you are generating in the conditional attribute and calculate it in a variable, then render the variable inside the conditional attribute.
Comments: My own note, this was a regression between Razor v1 and v2.