Metalama (preview)API documentationAspect APIMetalama.​Framework.​CodeIterator­Info
Open sandboxFocus

IteratorInfo Struct

Information about an iterator method, returned by the GetIteratorInfo(IMethod) extension method of IMethod.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public readonly struct IteratorInfo

Properties

Name Description
EnumerableKind

Gets the kind of enumerable (IEnumerable, IEnumerator, IAsyncEnumerable, ...), regardless of whether the method is a yield-base iterator (see IsIteratorMethod).

IsIteratorMethod

Gets a value indicating whether the method is an iterator (i.e., has a yield return or yield break statement). This property evaluates to false for methods that return an enumerable type but do not use yield, and null for methods that are not defined in the current project.

ItemType

Gets the type of items being enumerated (the int in IEnumerable<int>).