private void Visit(
            ProcedureCoercionExpression expression,
            QualifiedModuleName module,
            Declaration scope,
            Declaration parent)
        {
            Visit(expression.WrappedExpression, module, scope, parent);

            switch (expression.Classification)
            {
            case ExpressionClassification.ResolutionFailed:
                AddFailedProcedureCoercionReference(expression, module, scope, parent);
                break;

            case ExpressionClassification.Unbound:
                AddUnboundDefaultMemberReference(expression, module, scope, parent);
                break;

            default:
                if (expression.ReferencedDeclaration != null)
                {
                    AddDefaultMemberReference(expression, module, scope, parent);
                }

                break;
            }
        }
        private void AddFailedProcedureCoercionReference(
            ProcedureCoercionExpression expression,
            QualifiedModuleName module,
            Declaration scope,
            Declaration parent)
        {
            var callSiteContext = expression.Context;
            var identifier      = callSiteContext.GetText();
            var selection       = callSiteContext.GetSelection();
            var callee          = expression.ReferencedDeclaration;
            var reference       = new IdentifierReference(
                module,
                scope,
                parent,
                identifier,
                selection,
                callSiteContext,
                callee,
                false,
                false,
                FindIdentifierAnnotations(module, selection.StartLine),
                false,
                isNonIndexedDefaultMemberAccess: true,
                defaultMemberRecursionDepth: expression.DefaultMemberRecursionDepth);

            _declarationFinder.AddFailedProcedureCoercionReference(reference);
        }
Exemple #3
0
 private void Visit(ProcedureCoercionExpression expression, Declaration parent, IBoundExpression withExpression)
 {
     Visit(expression.WrappedExpression, parent, withExpression);
 }