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
 "Introduce Variable" seems off
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
1986 Posts

Posted - Feb 09 2020 :  07:56:01 AM  Show Profile  Reply with Quote
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.

feline
Whole Tomato Software

United Kingdom
16896 Posts

Posted - Feb 11 2020 :  2:12:54 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000