I suggest you ...

Duck typing of interfaces

One of the features that was dropped from VB9 was dynamic interfaces:
http://download.microsoft.com/download/5/8/4/5841bc1a-e864-4423-bb75-d4f3c18c0af5/visual%20basic%209.0%20overview.doc

Any chance of bringing this back? I know it can be done at runtime:
http://www.codeproject.com/Articles/16074/DuckTyping-Runtime-Dynamic-Interface-Implementatio

But that looses the compile time type checking, which is the great advantage of dynamic interfaces -- it gives you the best of both worlds, you can define a set of behavior for an existing class without having to have control over that class, based upon it's public interface, with no chance of it failing because of a missing property or method (if the class doesn't meet the requirements for the interface, compilation fails).

31 votes
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
John Moreno 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

1 comment

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...
  • Martin Ross commented  ·   ·  Flag as inappropriate

    If this could be applied to anonymous types generated by Selects in Linq queries then it would be fantastic!

Feedback and Knowledge Base