Reporter | Ilya Ryzhenkov (orangy) |
---|---|
Created | Feb 11, 2011 8:14:56 PM |
Updated | Jun 29, 2011 7:41:54 PM |
Priority | Critical |
Type | Bug |
Fix versions | Mirabile Futurum |
State | Open |
Assignee | Olga Lobacheva (olka) |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
Compiler shows the following error:
error CS1973: 'Class1' has no applicable method named 'Extension' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
Obviously, needs QFs to cast or convert to static invocation.
Important in MVC3 because of ViewBag dynamic nature and lots of extension methods for HtmlHelper.
error CS1973: 'Class1' has no applicable method named 'Extension' but appears to have an extension method by that name. Extension methods cannot be dynamically dispatched. Consider casting the dynamic arguments or calling the extension method without the extension method syntax.
public class Class1 { private dynamic x; void Foo() { new Class1().Extension(x); } } public static class Class1Ex { public static void Extension(this Class1 c, string s){} }
Obviously, needs QFs to cast or convert to static invocation.
Important in MVC3 because of ViewBag dynamic nature and lots of extension methods for HtmlHelper.