Пример #1
0
 internal override TypeWithModifiers Substitute(AbstractTypeMap typeMap)
 {
     TypeWithModifiers substitutedReferencedType = typeMap.SubstituteType(_referencedType);
     return substitutedReferencedType.Is(_referencedType) ?
                new TypeWithModifiers(this) :
                new TypeWithModifiers(new ByRefReturnErrorTypeSymbol(substitutedReferencedType.Type, _countOfCustomModifiersPrecedingByRef),
                                      substitutedReferencedType.CustomModifiers);
 }
Пример #2
0
        internal override TypeWithModifiers Substitute(AbstractTypeMap typeMap)
        {
            TypeWithModifiers substitutedReferencedType = typeMap.SubstituteType(_referencedType);

            return(substitutedReferencedType.Is(_referencedType) ?
                   new TypeWithModifiers(this) :
                   new TypeWithModifiers(new ByRefReturnErrorTypeSymbol(substitutedReferencedType.Type, _countOfCustomModifiersPrecedingByRef),
                                         substitutedReferencedType.CustomModifiers));
        }
Пример #3
0
        public TypeWithModifiers SubstituteType(AbstractTypeMap typeMap)
        {
            var newTypeWithModifiers = typeMap.SubstituteType(this.Type);

            if (!newTypeWithModifiers.Is(this.Type))
            {
                return(new TypeWithModifiers(newTypeWithModifiers.Type, this.CustomModifiers.Concat(newTypeWithModifiers.CustomModifiers)));
            }
            else
            {
                return(this); // substitution had no effect on the type
            }
        }
Пример #4
0
 private static TypeSymbol SubstituteAllTypeParameters(AbstractTypeMap substitution, TypeSymbol type)
 {
     if (substitution != null)
     {
         TypeSymbol previous;
         do
         {
             previous = type;
             type = substitution.SubstituteType(type);
         } while (type != previous);
     }
     return type;
 }
Пример #5
0
        internal override ErrorTypeSymbol Substitute(AbstractTypeMap typeMap)
        {
            TypeSymbol substitutedReferencedType = typeMap.SubstituteType(_referencedType);

            return(substitutedReferencedType == _referencedType ? this : new ByRefReturnErrorTypeSymbol(substitutedReferencedType));
        }
Пример #6
0
 internal override ErrorTypeSymbol Substitute(AbstractTypeMap typeMap)
 {
     TypeSymbol substitutedReferencedType = typeMap.SubstituteType(this.referencedType);
     return substitutedReferencedType == this.referencedType ? this : new ByRefReturnErrorTypeSymbol(substitutedReferencedType);
 }