Closed WhitWaldo closed 1 year ago
Hello @WhitWaldo, thank you for submitting this issue. We will try to get back to you as soon as possible. Note to the PostSharp team, this ticket is being tracked in our dashboard under ID TP-33071.
I will decline this one because we don't want to go that path of fixing user's input.
I don't see how we could improve the error message in any significant way. The text CS1073: Unexpected token ';'
is what Roslyn gives us and we're just passing that along to you.
Given the class I'm looking to apply the aspect to:
And my aspect:
Applying the aspect as-is works exactly as expected. But applying either of the commented out lines throws an exception simply because there's a semicolon on the end. The error sheds no real light on that being the issue (simply that it cannot be parsed as an expression):
I would suggest either improving the error to suggest that the semicolon should be left off the expression or automatically accommodate that yourself (and just drop the semicolon from the end of the input text).
Thanks for the consideration!