Esempio n. 1
0
        private static bool IsAlreadyOrCanBecameIterator([NotNull] ICSharpFunctionDeclaration declaration, [NotNull] IType returnType)
        {
            if (declaration.IsIterator)
            {
                return(true);
            }
            if (declaration.IsAsync)
            {
                return(false);
            }

            if (returnType.IsGenericIEnumerable() ||
                returnType.IsGenericIEnumerator() ||
                returnType.IsIEnumerable() ||
                returnType.IsIEnumerator())
            {
                return(!declaration.Descendants <IReturnStatement>().Any());
            }

            return(false);
        }