public static bool IsIterator(this VBSyntax.MethodBlockBaseSyntax node)
 {
     return(GetMethodBlock(node).HasModifier(VBasic.SyntaxKind.IteratorKeyword));
 }
 private static VBSyntax.MethodBaseSyntax GetMethodBlock(VBSyntax.MethodBlockBaseSyntax node)
 {
     return(node.IsKind(VBasic.SyntaxKind.GetAccessorBlock) ? node.GetAncestor <VBSyntax.PropertyBlockSyntax>().PropertyStatement : node.BlockStatement);
 }
 /// <summary>
 /// Use in conjunction with <see cref="IMethodSymbolExtensions.ReturnsVoidOrAsyncTask(IMethodSymbol)" />
 /// </summary>
 public static bool MustReturn(this VBSyntax.MethodBlockBaseSyntax node)
 {
     return(!IsIterator(node) && node.IsKind(VBasic.SyntaxKind.FunctionBlock, VBasic.SyntaxKind.GetAccessorBlock) &&
            !node.IsIterator());
 }