Why does a method that returns a type result in an implicit typing of dynamic?

Viewed 49

In the following code snippet why does the implicitly typed variable be determined as a dynamic instead of the method's return type of FluentClass?

public static class DynamicTest
{
    public class FluentClass
    {
        public FluentClass SomeMethod(dynamic arg)
        {
            return this;
        }
    }
    public static void Main()
    {
        dynamic data = new { Data = 1 };

        var fluentClass = new FluentClass();
        // fluentClass variable is typed FluentClass
        var methodResult = fluentClass.SomeMethod(data);
        // methodResult variable is typed dynamic
    }
}
1 Answers
Related