Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
142 stars 166 forks source link

[LLC] Generated fields include _tokenCredential even when ctor is disabled #1255

Open chamons opened 3 years ago

chamons commented 3 years ago

If clients disable the default ctors, you will run into this error:

C:\Users\chhamo\Programming\azure-sdk-for-net\sdk\purview\Azure.Analytics.Purview.Catalog\src\Generated\PurviewTypes.cs(22,42): error CS0414: The field 'PurviewTypes._tokenCredential' is assigned but its value is never used [C:\Users\chhamo\Programming\azure-sdk-for-net\sdk\purview\Azure.Analytics.Purview.Catalog\src\Azure.Analyti
chamons commented 3 years ago

I looked into this. Here's what I found:

The current work around is either:

I am going to move this to our backlog for consideration in the future, if it becomes painful for future us.