I do not believe that this is a compiler error - section 7.6.11 of the C # 4 specification ( typeof operator) does not seem to provide any syntax that would lead it to action; Func<Func<>> is neither a valid type construct nor a valid name construct without a type name.
Regarding the case, though: I assume it is very rarely necessary (I didn’t even think about using it before, and I didn’t hear anyone ask for it), and therefore there is additional complexity in the language design, implementation and testing of the compiler considered to outweigh the benefits. This often happens with the question "why does C # have no X function," as Eric Lippert likes to point out :)
I was pleasantly surprised to see that this can be done at runtime:
Type unbound = typeof(Func<>); Type partiallyBound = unbound.MakeGenericType(new[] { unbound }); Console.WriteLine(partiallyBound);
I expected it to be invalid on a system like .NET, although I expect this to cause other problems.
source share