Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 "Introduce Variable" seems off

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 - Feb 09 2020 : 07:56:01 AM
Beside of the problems reported in relation to LINQ expressions, I see other situations where the type suggested is clear from the context but still wrongly suggested.




In this case: parts.Parts is a int property in the parts form, bp.TotalPieces is an int property too, yet suggested is the type of bp which is class BatchPart.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 11 2020 : 2:12:54 PM
Using C#, VS2019 and VA 2358 I have set up the following simple test case for this:

class TestFelineParts
{
    public int Parts { get; set; }
    public int TotalPieces { get; set; }
}

class feline_test_general
{
    private void testingIntVariableBrackets()
    {
        TestFelineParts parts = new TestFelineParts { Parts = 5, TotalPieces = 3 };
        TestFelineParts bp = new TestFelineParts { Parts = 2, TotalPieces = 1 };
        int partsAlreadyProduced;
        // test - select just the piece of code "(parts.Parts < 0)" and trigger
        // VA Introduce Variable.  Dialog prompts with:
        // bool name
        partsAlreadyProduced = (parts.Parts < 0) ? bp.TotalPieces - parts.Parts : parts.Parts;
    }
}

here VA works as expected. Can you please try this simple case in your solution, and see if it behaves the same? I am guessing that you will see the same results I did with this test code. In this case I am also guessing somehow VA is confused about the type of "parts.Parts" in this part of your code, but without checking what VA has to say when the caret is placed onto this variable, it is hard to know.

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