Esempio n. 1
0
        internal SignatureHelper GetMethodSignature()
        {
            m_parameterTypes ??= Type.EmptyTypes;

            m_signature = SignatureHelper.GetMethodSigHelper(m_module, m_callingConvention, m_inst != null ? m_inst.Length : 0,
                                                             m_returnType, m_returnTypeRequiredCustomModifiers, m_returnTypeOptionalCustomModifiers,
                                                             m_parameterTypes, m_parameterTypeRequiredCustomModifiers, m_parameterTypeOptionalCustomModifiers);

            return(m_signature);
        }
Esempio n. 2
0
        internal SignatureHelper GetMethodSignature()
        {
            if (m_parameterTypes == null)
            {
                m_parameterTypes = Array.Empty <Type>();
            }

            m_signature = SignatureHelper.GetMethodSigHelper(m_module, m_callingConvention, m_inst != null ? m_inst.Length : 0,
                                                             m_returnType == null ? typeof(void) : m_returnType, m_returnTypeRequiredCustomModifiers, m_returnTypeOptionalCustomModifiers,
                                                             m_parameterTypes, m_parameterTypeRequiredCustomModifiers, m_parameterTypeOptionalCustomModifiers);

            return(m_signature);
        }
Esempio n. 3
0
        public override bool Equals(object?obj)
        {
            SignatureHelper?other = obj as SignatureHelper;

            if (other == null)
            {
                return(false);
            }

            if (other.module != module ||
                other.returnType != returnType ||
                other.callConv != callConv ||
                other.unmanagedCallConv != unmanagedCallConv)
            {
                return(false);
            }

            if (arguments != null)
            {
                if (other.arguments == null)
                {
                    return(false);
                }
                if (arguments.Length != other.arguments.Length)
                {
                    return(false);
                }

                for (int i = 0; i < arguments.Length; i++)
                {
                    if (!other.arguments[i].Equals(arguments[i]))
                    {
                        return(false);
                    }
                }
            }
            else if (other.arguments != null)
            {
                return(false);
            }

            return(CompareOK(other.modreqs, modreqs) && CompareOK(other.modopts, modopts));
        }