Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA 2420: missing case in IF

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Mar 23 2022 : 07:27:21 AM
For whatever reason, VA thinks that in this if statement are missing case statements. But then gives: "The switch type isn't recognized as an enum."



C#, Win7, VS2017, .NET 4.52
4   L A T E S T    R E P L I E S    (Newest First)
Uniwares Posted - Mar 24 2022 : 09:51:29 AM
Makes sense, although I would not expect it anywhere. Took me by surprise.
feline Posted - Mar 24 2022 : 09:12:55 AM
That makes sense. It feels a little unexpected, but when you are inside a case statement it does make sense to offer the option.
Uniwares Posted - Mar 23 2022 : 12:36:35 PM
Yes, .Is() is correctly defined and shown as such (extension method on the Enum).

What I just noticed, that this happens anywhere inside a case of a switch (of any other type).
Then the option is offered, whatever is under the caret/cursor. Doh.
feline Posted - Mar 23 2022 : 11:44:00 AM
If you place the caret into "Is", does VA know what to make of this function call? Is something sensible shown in the context and definition fields, and does Alt-G do something sensible?

I don't get why this refactoring would be offered here. Is this command being offered a consistent bug? At least the error message is "reasonable", since the command cannot be run here.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000