public static bool IsEnumerator(this ITypeSymbol typeSymbol, Compilation compilation, out EnumeratorSymbols enumeratorSymbols)
        {
            if (typeSymbol is null)
            {
                throw new ArgumentNullException(nameof(typeSymbol));
            }
            if (compilation is null)
            {
                throw new ArgumentNullException(nameof(compilation));
            }

            var isEnumerator = typeSymbol.IsEnumeratorType(compilation, out var current, out var moveNext, out var reset, out var dispose);

            enumeratorSymbols = new EnumeratorSymbols(current, moveNext, reset, dispose);
            return(isEnumerator);
        }
Example #2
0
 internal EnumerableSymbols(IMethodSymbol getEnumerator, EnumeratorSymbols enumeratorSymbols)
 {
     GetEnumerator     = getEnumerator;
     EnumeratorSymbols = enumeratorSymbols;
 }