Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: CC00091 Method GetEnumerator should never be made static #696

@giggio

Description

@giggio

If a method is named GetEnumerator and returns an IEnumerator it should not be made static. If it was changed you could break existing foreachs. See reference on MSDN;

Example:

class MyList
{
    public System.Collections.IEnumerator GetEnumerator()
    {
        yield return "x";
        yield return "y";
    }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions