I suggest you ...

virtual static method in interfaces & generics

I want to be able to write code like this:

public T Create<T>() where T : new(string), operator +
{
return new T("something") + new T("something");
}

or this:

public interface IConverter<Tin, Tout>
{
static Tout Convert(Tin value);
}

public static Tout Convert<TConverter, Tin, Tout>(Tin value)
where TConverter : IConverter<Tin, Tout>
{
return TConverter.Convert(value);
}

94 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
SeeR shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

Thanks for taking the time to share this suggestion. This item has been around for a couple of versions of Visual Studio and we haven’t acted on it. Looking at the VS “15” plans, we’re not going to take action on this item, so we’re going to close it. If the suggestion is still relevant, please either take a look to see if there’s another suggestion that’s similar that you can vote on, or open a new suggestion.

- The Visual Studio Team

5 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base