★ wanayoo — archive 1999 https://github.com/code-cracker/code-cracker/issues/960Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: CC0030 (MakeLocalVariableConst) - False positive on reference types initialized to Nothing (VB) #960

Open
SJMakin opened this issue Dec 27, 2017 · 1 comment

Comments

@SJMakin
Copy link

@SJMakin SJMakin commented Dec 27, 2017

CC0030 (MakeLocalVariableConst) reported when it isn't applicable on reference types initialized to Nothing. Using the latest VB extension.

To recreate:
Dim test As ArgumentException = Nothing

Gets converted to:
Const test As ArgumentException = Nothing

This results in error BC30424 "Constants must be of an intrinsic or enumerated type, not a class, structure, type parameter, or array type.".

Expecting no diagnostic when a reference type is initialized to Nothing.

@giggio
Copy link
Member

@giggio giggio commented May 20, 2018

Bug confirmed.

@giggio giggio changed the title CC0030 (MakeLocalVariableConst) - False positive on reference types initialized to Nothing (VB) BUG: CC0030 (MakeLocalVariableConst) - False positive on reference types initialized to Nothing (VB) May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.