更新:2007 年 11 月
错误消息
“accessor”体不能是迭代器块,因为“type”不是迭代器接口类型当使用了迭代器访问器,但返回类型不是以下迭代器接口类型之一时会发生此错误:
示例
下面的示例生成 CS1624:
// CS1624.cs
using System;
using System.Collections;
class C
{
    public int Iterator
    // Try this instead:
    // public IEnumerable Iterator
    {
        get  // CS1624
        {
            yield return 1;
        }
    }
} | |