Example #1
0
        public void Applied()
        {
            if (UsedAsExpression && !CallingMethod.DoesReturnValue)
            {
                parseInfo.Script.Diagnostics.Error("The chosen overload for " + CallingMethod.Name + " does not return a value.", NameRange);
            }

            // Get optional parameter's restricted calls.
            OverloadChooser.Match?.CheckOptionalsRestrictedCalls(parseInfo, NameRange);

            // Check callinfo :)
            foreach (RestrictedCallType type in ((IApplyBlock)CallingMethod).CallInfo.GetRestrictedCallTypes())
            {
                parseInfo.RestrictedCallHandler.RestrictedCall(new RestrictedCall(type, parseInfo.GetLocation(NameRange), RestrictedCall.Message_FunctionCallsRestricted(CallingMethod.Name, type)));
            }
        }
        public void Applied()
        {
            if (_usedAsExpression && !Function.DoesReturnValue)
            {
                _parseInfo.Script.Diagnostics.Error("The chosen overload for " + Function.Name + " does not return a value.", _targetRange);
            }

            // Get optional parameter's restricted calls.
            _match?.CheckOptionalsRestrictedCalls(_parseInfo, _targetRange);

            // Check callinfo :)
            foreach (RestrictedCallType type in ((IApplyBlock)Function).CallInfo.GetRestrictedCallTypes())
            {
                _parseInfo.RestrictedCallHandler.RestrictedCall(new RestrictedCall(type, _parseInfo.GetLocation(_targetRange), RestrictedCall.Message_FunctionCallsRestricted(Function.Name, type)));
            }
        }