Пример #1
0
        protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
        {
            TypeDesc paramTypeConverted = CanonUtilites.ConvertToCanon(ParameterType, kind);

            if (paramTypeConverted != ParameterType)
            {
                return(Context.GetByRefType(paramTypeConverted));
            }

            return(this);
        }
Пример #2
0
        protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
        {
            bool needsChange = CanonUtilites.ConversionToCanonFormIsAChange(Context, Instantiation, kind);
            if (needsChange)
            {
                MetadataType openType = (MetadataType)GetTypeDefinition();
                Instantiation newInstantiation = CanonUtilites.ConvertInstantiationToCanonForm(Context, Instantiation, kind);
                return Context.GetInstantiatedType(openType, newInstantiation);
            }

            return this;
        }
Пример #3
0
        protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
        {
            TypeDesc paramTypeConverted = CanonUtilites.ConvertToCanon(ParameterType, kind);

            if (paramTypeConverted != ParameterType)
            {
                // Note: don't use the Rank property here, as that hides the difference
                // between a single dimensional MD array and an SZArray.
                return(Context.GetArrayType(paramTypeConverted, _rank));
            }

            return(this);
        }
Пример #4
0
        protected override TypeDesc ConvertToCanonFormImpl(CanonicalFormKind kind)
        {
            bool          needsChange;
            Instantiation canonInstantiation = CanonUtilites.ConvertInstantiationToCanonForm(Instantiation, kind, out needsChange);

            if (needsChange)
            {
                MetadataType openType = (MetadataType)GetTypeDefinition();
                return(Context.GetInstantiatedType(openType, canonInstantiation));
            }

            return(this);
        }