Duck typing of interfaces
One of the features that was dropped from VB9 was dynamic interfaces:
Any chance of bringing this back? I know it can be done at runtime:
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).
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
Martin Ross commented
If this could be applied to anonymous types generated by Selects in Linq queries then it would be fantastic!