Will the dynamic keyword in C#4 support extension methods?
问题 I'm listening to a talk about C#4 's dynamic keyword and I'm wondering... Will this feature be orthogonal to other .NET features, for example will it support extension methods? public static class StrExtension { public static string twice(this string str) { return str + str; } } ... dynamic x = "Yo"; x.twice(); // will this work? Note: This question was asked before C#4 was shipped which is why it's phrased in the future tense. 回答1: From the "New Features in C# 4" word doc: Dynamic lookup