Here is a query in Roslyn that makes this change:
References to local functions are now forbidden in expression trees, which may or may not change in the future (earlier they were generated as a reference to the name of the distorted method, which seemed incorrect). A new bug has been added for this.
Thus, the argument is as follows: when you refer to a method in the expression tree, it appears as a MethodCall expression with the given method name. If you reference a local function called ImageFileProperties , you would expect a MethodCall with the same name. The purpose of the expression tree must be parsed and deconstructed, so names are important there. But in fact, local functions are compiled as static functions with names of the type <Initialize>g__ImageFileProperties1_0 (in the link quoted above, it is referred to as the "searched method name"). For this reason, the developers (developers) of Roslyn decided simply not to allow this to avoid confusion (the name of the function that you see in the source code and the name of the function in the expression tree). There is no such confusion with an anonymous function, so they are allowed.
source share