SharpDevelop Community

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

Overload resolution in tooltips #2 / generics problem

Last post 05-10-2008 8:46 PM by DanielGrunwald. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-26-2008 3:56 PM

    Overload resolution in tooltips #2 / generics problem

     Hi again,

    I've upgraded to #D 2994. Some weirdness in tooltip overload resolution seems to be added here.

    I use the collections class from iDesign which has the following method group:

        public static T[ ToArray<T>(IEnumerable<T> collection)

       public static T[ ToArray<T>(IEnumerator<T> iterator)

       public static T[ ToArray<T>(IEnumerable<T> collection,int count)

       public static T[ ToArray<T>(IEnumerator<T> iterator,int count)

       public static U[ ToArray<T,U>(IEnumerable<T> collection,Converter<T,U> converter)

       public static U[ ToArray<T,U>(IEnumerable<T> collection,Converter<T,U> converter,int count)

       public static U[ ToArray<T,U>(IEnumerator<T> iterator,Converter<T,U> converter)

       public static U[ ToArray<T,U>(IEnumerator<T> iterator,Converter<T,U> converter,int count)

    But 

     Collection.ToArray(statSnapshot[step].Values);

     gives me the last (most complex) overload.

    Also, I do not get code completion beyond the above statSnapshot[step].Values,which is a ValueCollection<TKey,TValue> and should expose some members.

    Likewise: 

    Correct: 

      Array.Sort(stats, delegate(ItemStats a, ItemStats b){...});
     

    Incorrect:

    Array.Sort(stats, (a, b) => ...);

    This case remains showing an incorrect tooltip when lambda parameters are explicitly typed.


    I've mixed them up since all of them involve mixed-arity template overloads, so I suspect a common cause.

     Regards,

    Simon

     

  • 05-10-2008 8:46 PM In reply to

    Re: Overload resolution in tooltips #2 / generics problem

    Code completion fails for nested classes inside generic classes.

    SharpDevelop cannot find "Dictionary<X, Y>.KeyCollection", so code completion cannot infer T.

    However, one of the single-argument overloads should be chosen - this works for me now (overload resolution was rewritten in revision 3010).

    Array.Sort with implicitly typed lambda works for me, too (implicitly typed lambda support was added in r3010).

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