Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 VA 2420: missing case in IF
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 23 2022 :  07:27:21 AM  Show Profile  Reply with Quote
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

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Mar 23 2022 :  11:44:00 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 23 2022 :  12:36:35 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19024 Posts

Posted - Mar 24 2022 :  09:12:55 AM  Show Profile  Reply with Quote
That makes sense. It feels a little unexpected, but when you are inside a case statement it does make sense to offer the option.

zen is the art of being at one with the two'ness
Go to Top of Page

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Mar 24 2022 :  09:51:29 AM  Show Profile  Reply with Quote
Makes sense, although I would not expect it anywhere. Took me by surprise.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000