Ejemplo n.º 1
0
        private void VisitMethodBody(SyntaxNode memberSyntax)
        {
            var compilation    = _modelBuilder.GetCompilation(memberSyntax.SyntaxTree);
            var methodSemantic = compilation.GetSemanticModel(memberSyntax.SyntaxTree, ignoreAccessibility: true);

            var bodySyntax    = (memberSyntax is MethodDeclarationSyntax method ? method.Body : memberSyntax);
            var bodyOperation = methodSemantic.GetOperation(bodySyntax);

            if (bodyOperation != null)
            {
                var walker = new TypeDiscoveryOperationWalker(type => type.Accept(this));
                bodyOperation.Accept(walker);
            }
        }