Exemple #1
0
        private static bool IsPotentiallyAssignedByRefEventArgument(QualifiedModuleName module, IdentifierReference reference, DeclarationFinder finder)
        {
            var eventArgExpression = ImmediateEventArgumentExpressionContext(reference);

            if (eventArgExpression == null ||
                eventArgExpression.BYVAL() != null)
            {
                return(false);
            }

            var parameter = finder.FindParameterFromSimpleEventArgumentNotPassedByValExplicitly(eventArgExpression, module);

            if (parameter == null)
            {
                //We have no idea what parameter it is passed to as argument. So, we have to err on the safe side and assume it is passed by reference.
                return(true);
            }

            return(parameter.IsByRef);
        }