这是Visual Studio 2019中的错误吗?调试时出现程序错误CS0570

考虑以下接口和实现该接口的虚拟类。

interface I<out T>
{
    System.Collections.Generic.IEnumerable<T> M()
    {
        var x = default(T);
        yield return x;
    }
}

public class C : I<string>
{
    public static void Main() => System.Linq.Enumerable.Any(((I<string>)new C()).M());
}

现在在第6行上设置一个断点(收益率x)。 执行该程序,如果您看x会发现一些奇怪的现象,它告诉您以下内容:

错误CS0570:语言不支持'<> x。<> m0(I.d__0)'

Obviously, the program works so it is supported by the language, but the debugger has no idea what to do with it. This also happens for async (Task{T},ValueTask{T}, or IAsyncEnumerable<T>) returning methods.

在通常的评论流之前,这不是我的实际代码。我有一个使用默认接口成员(接口版本控制)的实际有效用例,我的实际方法更复杂,并且调用了该接口的其他成员,但是dim是中的生成器方法,而调试不兼容的实现者是一场噩梦。 ,而我基本上不得不诉诸日志消息。