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 2389: more suggestion troubles
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Sep 08 2020 :  10:17:25 AM  Show Profile  Reply with Quote
I definitely do understand that its hard to suggest an item but at least the type would be really nice to get right.

here, the only symbols that can be inserted would be "new SerialNumber" or "sn1" or null. The definition of ForceReset is:
public static SerialNumberReset ForceReset(SerialNumber sn);




feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Sep 08 2020 :  11:08:29 AM  Show Profile  Reply with Quote
Does VA know / understand the type of "_project"? I see it as a parameter above, and it is in bold, suggesting a local variable, so VA should know what this is, and that it does not match the type for this function parameter.

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

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Sep 08 2020 :  11:16:01 AM  Show Profile  Reply with Quote
Definitely does, _project is a class member, as is _machine. sng is of type SerialNumberGenerator. (actually on this shot I am using the static method like a instance method, but after correcting this the result was the same, just in case anyone wonders)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Sep 08 2020 :  11:28:19 AM  Show Profile  Reply with Quote
I have tried the following very simple test case, can you try the following code, just to see if you get a reasonable VA listbox please:

namespace uniwares_testing
{
    class SerialNumber
    {
        public int projectReference { get; set; }
        public int internalNumber { get; set; }
        public SerialNumber GenerateSerialNumber(int _project, SerialNumber baseNumber)
        {
            SerialNumber newNumber = new SerialNumber();
            newNumber.projectReference = _project;
            newNumber.internalNumber = baseNumber.internalNumber + 1;
            return newNumber;
        }

        public void ForceReset(SerialNumber sn)
        {
            sn.internalNumber = -1;
        }
    }

    class testUsingSerialNumber
    {
        void simpleTest()
        {
            SerialNumber sng = new SerialNumber();
            int _project = 2;
            // Test - type "(" after "ForceReset" on the line below to get VA listbox
            sng.ForceReset;
        }
    }
}

I need to work out / look up how to get a function that takes a Lambda expression as a parameter to get a better test, but this is a start point.

I wonder if the problem is because we are inside the Lambda statement, but if so, why is VA confused by a function call on "sng" when this is being shown in bold as a local variable... rather strange.

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

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Sep 08 2020 :  11:32:24 AM  Show Profile  Reply with Quote


Go to Top of Page

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Sep 08 2020 :  11:36:48 AM  Show Profile  Reply with Quote
For the lambdas parameters you define the method like this:
public void MyMethod(int inparameter, Action<LambdaParameterType> lambdaexpression);

this gives you:
MyMethod(10, lpt => { if(lpt is LambdaParameterType) ... ;} );


Thats just one of the many methods...
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Sep 10 2020 :  12:07:44 PM  Show Profile  Reply with Quote
I have worked out a simple test case here, that seems to capture the situation you have. At 150 lines of C# its a bit big for a forum post, so I have emailed you my test solution, can you please have a look when you get it, and let me know if I am testing the right thing or not here:

case=142860

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:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000