SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Intellisense on generics (#D2.2.1)

Last post 05-14-2008 5:56 PM by jaredcooper. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-26-2008 3:41 PM

    Intellisense on generics (#D2.2.1)

    Given the following:

    using System;
    using System.Collections.ObjectModel;
    namespace generic_test
    {
      public class ParentCollection<T> : Collection<T>{
        // ......... inherit from generic collection object
     
    }

      public
    class A{
        public int someProperty{
          get{ return 1; }
        }
        public A(){
        }
      }

      public
    class ChildCollection : ParentCollection<A>{
        // ......... inherit from ParentCollection but specify type-modifier
      }

      public
    class B{
        ChildCollection coll
    = new ChildCollection();
        public
    B
    (){
          coll[0].
        }
      }

    }
    ---------------------
    Given the last, unifinished, code line ( coll[0]. )  as typing, when the [ character is typed, intellisense pops up showing
    Sealed T System.Collections.OjectModel.Collection.this[int index]

    Continuing to the point of typing the . after the indexer, intellisense doesn't popup at all.

    It looks like it's not recognising that the ChildCollection class has the type modifier of A.  Since only instances of class A can be added to this collection, the indexer should be reckognised as returning A and intellisense popping up with the someProperty property shown.  Instead, intellisense seams to skip the ChildCollection definition and go straight to the Collection<T> class.

    It's only intellisense that's not working as I'd expect it, code that assumes instance of A are returned by the indexer compile and work correctly.

    Is this an issue with #D's intellisense, or just the way I'm making the class definitions (or am I just expecting behaviour that's not feasible to implement).  If there's a way to get what I want and still get intellisense to work, please let me know.

    Thanks in advance

  • 05-09-2008 4:41 PM In reply to

    Re: Intellisense on generics (#D2.2.1)

    This was a bug in SharpDevelop's code completion implementation. Fixed in revision 3049. 

    Daniel Grunwald
  • 05-14-2008 5:56 PM In reply to

    Re: Intellisense on generics (#D2.2.1)

    Thanks, Daniel.

Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.