Will the dynamic keyword in C#4 support extension methods?-Collection of common programming errors
This works which I find interesting at least…
public static class StrExtension
{
public static string twice(this string str) { return str + str; }
}
...
dynamic x = "Yo";
StrExtension.twice(x);
Still, if the compiler can find the correct extension method at compile time then I don’t see why it can’t package up a set of extension methods to be looked up at runtime? It would be like a v-table for non-member methods.
EDIT:
This is cool… http://www2.research.att.com/~bs/multimethods.pdf