void CheckGeneratorReturnType(Method method, IType returnType)
{
bool validReturnType =
(TypeSystemServices.IEnumerableType == returnType ||
TypeSystemServices.IEnumeratorType == returnType ||
TypeSystemServices.IsSystemObject(returnType) ||
TypeSystemServices.IsGenericGeneratorReturnType(returnType));
if (!validReturnType)
{
Error(CompilerErrorFactory.InvalidGeneratorReturnType(method.ReturnType, returnType));
}
}