private IndirectFieldSpecialization(
     IField declaration,
     TypeSpecialization parentType)
 {
     this.Declaration = declaration;
     this.parentTy    = parentType;
 }
 /// <summary>
 /// Creates a generic field specialization of a particular generic
 /// field declaration.
 /// </summary>
 /// <param name="declaration">
 /// The generic field declaration that is specialized into
 /// a concrete field.
 /// </param>
 /// <param name="parentType">
 /// A specialization of the generic declaration's parent type.
 /// </param>
 /// <returns>A specialization of the generic declaration.</returns>
 internal static IndirectFieldSpecialization Create(
     IField declaration,
     TypeSpecialization parentType)
 {
     return(instanceCache.Intern(
                new IndirectFieldSpecialization(declaration, parentType)));
 }
 private IndirectPropertySpecialization(
     IProperty declaration,
     TypeSpecialization parentType)
 {
     this.Declaration           = declaration;
     this.specializedParentType = parentType;
 }
 /// <summary>
 /// Creates a generic property specialization of a particular generic
 /// property declaration.
 /// </summary>
 /// <param name="declaration">
 /// The generic property declaration that is specialized into
 /// a concrete property.
 /// </param>
 /// <param name="parentType">
 /// A specialization of the generic declaration's parent type.
 /// </param>
 /// <returns>A specialization of the generic declaration.</returns>
 internal static IndirectPropertySpecialization Create(
     IProperty declaration,
     TypeSpecialization parentType)
 {
     return(instanceCache.Intern(
                new IndirectPropertySpecialization(declaration, parentType)));
 }
 internal IndirectMethodSpecialization(
     IMethod declaration,
     TypeSpecialization parentType)
     : base(declaration)
 {
     this.parentTy = parentType;
 }
Beispiel #6
0
 /// <summary>
 /// Creates an uninitialized generic instance type.
 /// </summary>
 /// <param name="declaration">The type's declaration.</param>
 /// <param name="parentType">The type's parent type.</param>
 private IndirectTypeSpecialization(
     IType declaration,
     TypeSpecialization parentType)
     : base(declaration)
 {
     this.ParentType = parentType;
 }
 /// <summary>
 /// Creates a generic instance method from a generic declaration
 /// and a parent type that is itself an (indirect) generic type.
 /// </summary>
 /// <param name="declaration">
 /// The generic declaration to specialize.
 /// </param>
 /// <param name="parentType">
 /// A specialization of the generic declaration's parent type.
 /// </param>
 /// <returns>A specialization of the generic declaration.</returns>
 internal static IndirectMethodSpecialization Create(
     IMethod declaration,
     TypeSpecialization parentType)
 {
     if (declaration is IAccessor)
     {
         var accessor = (IAccessor)declaration;
         return(Create(
                    accessor,
                    IndirectPropertySpecialization.Create(
                        accessor.ParentProperty,
                        parentType)));
     }
     else
     {
         return(instanceCache.Intern(
                    new IndirectMethodSpecialization(declaration, parentType)));
     }
 }