Ejemplo n.º 1
0
        /// <summary>
        /// Creates a SemanticModel for the method.
        /// </summary>
        internal static MethodBodySemanticModel Create(CSharpCompilation compilation, MethodSymbol owner, ExecutableCodeBinder executableCodeBinder,
                                                       CSharpSyntaxNode syntax, BoundNode boundNode = null)
        {
            var result = new MethodBodySemanticModel(compilation, owner, executableCodeBinder, syntax);

            if (boundNode != null)
            {
                result.UnguardedAddBoundTreeForStandaloneSyntax(syntax, boundNode);
            }

            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates a SemanticModel for the method.
        /// </summary>
        internal static MethodBodySemanticModel Create(SyntaxTreeSemanticModel containingSemanticModel, MethodSymbol owner, ExecutableCodeBinder executableCodeBinder,
                                                       CSharpSyntaxNode syntax, BoundNode boundNode = null)
        {
            Debug.Assert(containingSemanticModel != null);
            var result = new MethodBodySemanticModel(owner, executableCodeBinder, syntax, containingSemanticModel);

            if (boundNode != null)
            {
                result.UnguardedAddBoundTreeForStandaloneSyntax(syntax, boundNode);
            }

            return(result);
        }