postsharp / Metalama

Metalama is a Roslyn-based meta-programming framework. Use this repo to report bugs or ask questions.
164 stars 4 forks source link

Metalama fails with a simple aspect usage #225

Closed XtroTheArctic closed 9 months ago

XtroTheArctic commented 9 months ago

From Slack: Here I am with a new bug report. The repro steps are super simple which makes me think this is a seriously big bug. Normally, my "Atesh" solution and Atesh project in it is just a library. It doesn't have an executable app project in it. Today, I added a console app project in it to test something in runtime and Metalama just started to fail. It only fails when I use NotNullOrWhiteSpace aspect in Aaa method. When I delete that aspect it compiles fine. Is there any Git repo I should post this as a bug? And can you help me please? Oh, I'm on 2023.2.4. I upgraded to 2023.2.5 but the result is the same. image

Logs are attached: log.zip

PostSharpBot commented 9 months ago

Hello @XtroTheArctic, 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-33871.

svick commented 9 months ago

Thanks for the report.

Metalama currently does not support aspects on local functions. I'm going to improve the error message, which means you're going to have to change your code and turn the local function into a regular method in a class.

XtroTheArctic commented 9 months ago

Thank you. That will work for me for now. I hope in the future that feature is added. Thank you.

prochan2 commented 9 months ago

Fixed in Metalama 2023.4.3-preview.