Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA 2389: more suggestion troubles

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

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

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 - Sep 08 2020 : 10:17:25 AM
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);

6   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 10 2020 : 12:07:44 PM
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:

Uniwares Posted - Sep 08 2020 : 11:36:48 AM
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...
Uniwares Posted - Sep 08 2020 : 11:32:24 AM

feline Posted - Sep 08 2020 : 11:28:19 AM
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

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.
Uniwares Posted - Sep 08 2020 : 11:16:01 AM
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)
feline Posted - Sep 08 2020 : 11:08:29 AM
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.

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