Trying out the Razor view engine and for some reason my generic helper methods are breaking. For example:

public static class UrlHelperExtensions
    public static string NonGenericHelper(this UrlHelper helper, Type controller)
        return controller.Name;

    public static string GenericHelper<TController>(this UrlHelper helper)
        return typeof(TController).Name;

Works as expected:


Breaks with the following exception:


"CS1502: The best overloaded method match for 'Microsoft.WebPages.WebPageUltimateBase.Write(Microsoft.WebPages.Helpers.HelperResult)' has some invalid arguments"

The only workaround I could find is treating it as a "multi-token statement":


Not sure if this is the intended behavior or just a bug but it would be nice to be able to call a generic method as you would a non generic one.

Update: Brad Wilson mentions the following: "That is the intended behavior, because otherwise the parser would not be able to tell the difference between a generic and a piece of HTML content. Using the surrounding ( ) disambiguates it."