Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 method list ignores generics with constraints (C#)

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
tom_seddon Posted - Feb 23 2008 : 2:26:06 PM
Hi

The following small file demonstrates the problem:


using System;
using System.Collections.Generic;
using System.Text;

namespace X
{
    abstract class Class1
    {
        public abstract void Test();
        public abstract void Test2<T>() where T:new();
        public abstract void Test3();
        public abstract void Test4();
    }
}


If you use the methods list on this file, you'll see that Test2 is not listed.

Remove the "where" clause, and it starts to appear.

If you give the functions bodies (replace ";" with "{}"), the methods list shows only functions that are before the constrained one in the file.

If you give Test2 a body consisting of an empty inner scope:


        public abstract void Test2<T>() where T:new()
        {
            {
            }
        }


then VAX does a slightly better job, ignoring only the constrained function and the one following it.

Thanks,

--Tom
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Feb 25 2008 : 08:05:42 AM
I am seeing the same effect here. Thank you for the very clear description.

case=6681

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