Abstract base class for mutable and immutable type maps.
コード例 #1
0
ファイル: TypeWithModifiers.cs プロジェクト: ruo2012/peachpie
        public TypeWithModifiers SubstituteType(AbstractTypeMap typeMap)
        {
            var newCustomModifiers   = typeMap.SubstituteCustomModifiers(this.CustomModifiers);
            var newTypeWithModifiers = typeMap.SubstituteType(this.Type);

            if (!newTypeWithModifiers.Is(this.Type) || newCustomModifiers != this.CustomModifiers)
            {
                return(new TypeWithModifiers(newTypeWithModifiers.Type, newCustomModifiers.Concat(newTypeWithModifiers.CustomModifiers)));
            }
            else
            {
                return(this); // substitution had no effect on the type or modifiers
            }
        }
コード例 #2
0
ファイル: ErrorTypeSymbol.cs プロジェクト: iolevel/peachpie
 /// <summary>
 /// Called by <see cref="AbstractTypeMap.SubstituteType"/> to perform substitution
 /// on types with TypeKind ErrorType.  The general pattern is to use the type map
 /// to perform substitution on the wrapped type, if any, and then construct a new
 /// error type symbol from the result (if there was a change).
 /// </summary>
 internal virtual TypeWithModifiers Substitute(AbstractTypeMap typeMap)
 {
     return new TypeWithModifiers((ErrorTypeSymbol)typeMap.SubstituteNamedType(this));
 }
コード例 #3
0
ファイル: ErrorTypeSymbol.cs プロジェクト: ruo2012/peachpie
 /// <summary>
 /// Called by <see cref="AbstractTypeMap.SubstituteType"/> to perform substitution
 /// on types with TypeKind ErrorType.  The general pattern is to use the type map
 /// to perform substitution on the wrapped type, if any, and then construct a new
 /// error type symbol from the result (if there was a change).
 /// </summary>
 internal virtual TypeWithModifiers Substitute(AbstractTypeMap typeMap)
 {
     return(new TypeWithModifiers((ErrorTypeSymbol)typeMap.SubstituteNamedType(this)));
 }