Invalid code is generated for some locales (e.g. sv-ES)
rogeralsing opened this issue · 10 comments
@rogeralsing
When I use your example code, it works just fine?
Can you take a look at this example : https://github.com/StefH/ProxyInterfaceSourceGenerator/tree/akka/src-examples/ProxyInterfaceConsumerForAkka
I do have a hunch on what this is.
dotnet/runtime#26778
The dash there is −
which is not the same as -
minus (see how the first is wider).
@rogeralsing
Can you please go to "dependencies --> analyzers --> ProxyInterfaceSourceGenerator" and copy-paste the generated C# file which causes compile errors?
I see. Thank you very much for your analysis. I know the cause from this error, I'll keep you up to date here on the progress.
@rogeralsing
Issue is related to this line: https://github.com/StefH/ProxyInterfaceSourceGenerator/blob/main/src/ProxyInterfaceSourceGenerator/Extensions/StringExtensions.cs#L26 , I'll fix this.
Some questions:
- Do you use Rider or a different visual studio?
- What is your locale / country on your PC?
Swedish locale.
Mac
Rider
I believe the issue at hand here is Mac (Or even *Nix?) that the minus sign is a different character.
I'm not sure if this is related to specifically Swedish locale.
That is actually the locale used in this bugreport:
dotnet/runtime#26778 (comment)
@rogeralsing
Code is fixed, a new NuGet will be released shortly.
Awesome! thanks