Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBUG: CC0021 generates a use NameOf for a constant defined as itself #925
Comments
|
@CZEMacLeod This analyzer checks if value of variable it´s equal your name and then suggest a fix; |
|
I'm not quite sure what you mean by that. |
|
@CZEMacLeod It's make sense, A solution it's ignore rule in variable declaration, when name and value are same. What do you think about ? |
|
Yeah - That is what is required. Do not offer CC0021 when the nameof operator would point to the item you are declaring. |
#Bug
CC0021 suggests using a constant definition name as itself which does not compile.
Current output after fix applied:
Error:
BC30500 Constant 'MyConst' cannot depend on its own value.