TypeParameterSymbol.cs 22.0 KB
Newer Older
1
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.
P
Pilchie 已提交
2

3
using System;
P
Pilchie 已提交
4 5
using System.Collections.Generic;
using System.Collections.Immutable;
6
using Microsoft.CodeAnalysis.PooledObjects;
P
Pilchie 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
using Roslyn.Utilities;

namespace Microsoft.CodeAnalysis.CSharp.Symbols
{
    /// <summary>
    /// Represents a type parameter in a generic type or generic method.
    /// </summary>
    internal abstract partial class TypeParameterSymbol : TypeSymbol, ITypeParameterSymbol
    {
        /// <summary>
        /// The original definition of this symbol. If this symbol is constructed from another
        /// symbol by type substitution then OriginalDefinition gets the original symbol as it was defined in
        /// source or metadata.
        /// </summary>
        public new virtual TypeParameterSymbol OriginalDefinition
        {
            get
            {
                return this;
            }
        }

        protected override sealed TypeSymbol OriginalTypeSymbolDefinition
        {
            get
            {
                return this.OriginalDefinition;
            }
        }

        /// <summary>
        /// If this is a type parameter of a reduced extension method, gets the type parameter definition that
        /// this type parameter was reduced from. Otherwise, returns Nothing.
        /// </summary>
        public virtual TypeParameterSymbol ReducedFrom
        {
            get
            {
                return null;
            }
        }

        /// <summary>
        /// The ordinal position of the type parameter in the parameter list which declares
        /// it. The first type parameter has ordinal zero.
        /// </summary>
        public abstract int Ordinal
        {
            // This is needed to determine hiding in C#: 
            //
            // interface IB { void M<T>(C<T> x); }
            // interface ID : IB { new void M<U>(C<U> x); }
            //
            // ID.M<U> hides IB.M<T> even though their formal parameters have different
            // types. When comparing formal parameter types for hiding purposes we must
            // compare method type parameters by ordinal, not by identity.
            get;
        }

        internal virtual DiagnosticInfo GetConstraintsUseSiteErrorInfo()
        {
            return null;
        }

        /// <summary>
        /// The types that were directly specified as constraints on the type parameter.
        /// Duplicates and cycles are removed, although the collection may include
        /// redundant constraints where one constraint is a base type of another.
        /// </summary>
C
Charles Stoner 已提交
76 77 78 79 80 81 82 83 84 85 86 87
        internal ImmutableArray<TypeSymbolWithAnnotations> GetConstraintTypesNoUseSiteDiagnostics(ConsList<TypeParameterSymbol> inProgress, bool early)
        {
            // We could call EnsureAllConstraintsAreResolved(early) directly rather than splitting
            // this into two separate calls. However, the split between early and late must be explicit
            // somewhere to ensure that the early work for all sibling type parameters is completed
            // before the late work for any sibling. It seems simpler to handle the split here (in the
            // one caller of EnsureAllConstraintsAreResolved that supports the late phase) rather than
            // in several implementations of the abstract EnsureAllConstraintsAreResolved method.
            this.EnsureAllConstraintsAreResolved(early: true);
            if (!early)
            {
                this.EnsureAllConstraintsAreResolved(early);
P
Pilchie 已提交
88
            }
C
Charles Stoner 已提交
89
            return this.GetConstraintTypes(inProgress, early);
P
Pilchie 已提交
90 91
        }

C
Charles Stoner 已提交
92 93 94
        internal ImmutableArray<TypeSymbolWithAnnotations> ConstraintTypesNoUseSiteDiagnostics =>
            GetConstraintTypesNoUseSiteDiagnostics(ConsList<TypeParameterSymbol>.Empty, early: false);

95
        internal ImmutableArray<TypeSymbolWithAnnotations> ConstraintTypesWithDefinitionUseSiteDiagnostics(ref HashSet<DiagnosticInfo> useSiteDiagnostics)
P
Pilchie 已提交
96 97 98 99 100 101 102
        {
            var result = ConstraintTypesNoUseSiteDiagnostics;

            AppendConstraintsUseSiteErrorInfo(ref useSiteDiagnostics);

            foreach (var constraint in result)
            {
103
                ((TypeSymbol)constraint.TypeSymbol.OriginalDefinition).AddUseSiteDiagnostics(ref useSiteDiagnostics);
P
Pilchie 已提交
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
            }

            return result;
        }

        private void AppendConstraintsUseSiteErrorInfo(ref HashSet<DiagnosticInfo> useSiteDiagnostics)
        {
            DiagnosticInfo errorInfo = this.GetConstraintsUseSiteErrorInfo();

            if ((object)errorInfo != null)
            {
                if (useSiteDiagnostics == null)
                {
                    useSiteDiagnostics = new HashSet<DiagnosticInfo>();
                }

                useSiteDiagnostics.Add(errorInfo);
            }
        }

        /// <summary>
        /// True if the parameterless constructor constraint was specified for the type parameter.
        /// </summary>
        public abstract bool HasConstructorConstraint { get; }

        /// <summary>
        /// The type parameter kind of this type parameter.
        /// </summary>
        public abstract TypeParameterKind TypeParameterKind { get; }

        /// <summary>
        /// The method that declared this type parameter, or null.
        /// </summary>
        public MethodSymbol DeclaringMethod
        {
            get
            {
                return this.ContainingSymbol as MethodSymbol;
            }
        }

        /// <summary>
        /// The type that declared this type parameter, or null.
        /// </summary>
        public NamedTypeSymbol DeclaringType
        {
            get
            {
                return this.ContainingSymbol as NamedTypeSymbol;
            }
        }

        // Type parameters do not have members
        public sealed override ImmutableArray<Symbol> GetMembers()
        {
            return ImmutableArray<Symbol>.Empty;
        }

        // Type parameters do not have members
        public sealed override ImmutableArray<Symbol> GetMembers(string name)
        {
            return ImmutableArray<Symbol>.Empty;
        }

        // Type parameters do not have members
        public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers()
        {
            return ImmutableArray<NamedTypeSymbol>.Empty;
        }

        // Type parameters do not have members
        public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name)
        {
            return ImmutableArray<NamedTypeSymbol>.Empty;
        }

        // Type parameters do not have members
        public sealed override ImmutableArray<NamedTypeSymbol> GetTypeMembers(string name, int arity)
        {
            return ImmutableArray<NamedTypeSymbol>.Empty;
        }

        internal override TResult Accept<TArgument, TResult>(CSharpSymbolVisitor<TArgument, TResult> visitor, TArgument argument)
        {
            return visitor.VisitTypeParameter(this, argument);
        }

        public override void Accept(CSharpSymbolVisitor visitor)
        {
            visitor.VisitTypeParameter(this);
        }

        public override TResult Accept<TResult>(CSharpSymbolVisitor<TResult> visitor)
        {
            return visitor.VisitTypeParameter(this);
        }

        public sealed override SymbolKind Kind
        {
            get
            {
                return SymbolKind.TypeParameter;
            }
        }

        public sealed override TypeKind TypeKind
        {
            get
            {
                return TypeKind.TypeParameter;
            }
        }

        // Only the compiler can create TypeParameterSymbols.
        internal TypeParameterSymbol()
        {
        }

        public sealed override Accessibility DeclaredAccessibility
        {
            get
            {
                return Accessibility.NotApplicable;
            }
        }

        public sealed override bool IsStatic
        {
            get
            {
                return false;
            }
        }

        public sealed override bool IsAbstract
        {
            get
            {
                return false;
            }
        }

        public sealed override bool IsSealed
        {
            get
            {
                return false;
            }
        }

254
        internal sealed override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => null;
P
Pilchie 已提交
255

256
        internal sealed override ImmutableArray<NamedTypeSymbol> InterfacesNoUseSiteDiagnostics(ConsList<Symbol> basesBeingResolved = null)
P
Pilchie 已提交
257
        {
258
            return ImmutableArray<NamedTypeSymbol>.Empty;
P
Pilchie 已提交
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
        }

        protected override ImmutableArray<NamedTypeSymbol> GetAllInterfaces()
        {
            return ImmutableArray<NamedTypeSymbol>.Empty;
        }

        /// <summary>
        /// The effective base class of the type parameter (spec 10.1.5). If the deduced
        /// base type is a reference type, the effective base type will be the same as
        /// the deduced base type. Otherwise if the deduced base type is a value type,
        /// the effective base type will be the most derived reference type from which
        /// deduced base type is derived.
        /// </summary>
        internal NamedTypeSymbol EffectiveBaseClassNoUseSiteDiagnostics
        {
            get
            {
C
Charles Stoner 已提交
277
                this.EnsureAllConstraintsAreResolved(early: false);
P
Pilchie 已提交
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301
                return this.GetEffectiveBaseClass(ConsList<TypeParameterSymbol>.Empty);
            }
        }

        internal NamedTypeSymbol EffectiveBaseClass(ref HashSet<DiagnosticInfo> useSiteDiagnostics)
        {
            AppendConstraintsUseSiteErrorInfo(ref useSiteDiagnostics);
            var result = EffectiveBaseClassNoUseSiteDiagnostics;

            if ((object)result != null)
            {
                result.OriginalDefinition.AddUseSiteDiagnostics(ref useSiteDiagnostics);
            }

            return result;
        }

        /// <summary>
        /// The effective interface set (spec 10.1.5).
        /// </summary>
        internal ImmutableArray<NamedTypeSymbol> EffectiveInterfacesNoUseSiteDiagnostics
        {
            get
            {
C
Charles Stoner 已提交
302
                this.EnsureAllConstraintsAreResolved(early: false);
P
Pilchie 已提交
303 304 305 306 307 308 309 310 311 312 313
                return this.GetInterfaces(ConsList<TypeParameterSymbol>.Empty);
            }
        }

        /// <summary>
        /// The most encompassed type (spec 6.4.2) from the constraints.
        /// </summary>
        internal TypeSymbol DeducedBaseTypeNoUseSiteDiagnostics
        {
            get
            {
C
Charles Stoner 已提交
314
                this.EnsureAllConstraintsAreResolved(early: false);
P
Pilchie 已提交
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369
                return this.GetDeducedBaseType(ConsList<TypeParameterSymbol>.Empty);
            }
        }

        internal TypeSymbol DeducedBaseType(ref HashSet<DiagnosticInfo> useSiteDiagnostics)
        {
            AppendConstraintsUseSiteErrorInfo(ref useSiteDiagnostics);
            var result = DeducedBaseTypeNoUseSiteDiagnostics;

            if ((object)result != null)
            {
                ((TypeSymbol)result.OriginalDefinition).AddUseSiteDiagnostics(ref useSiteDiagnostics);
            }

            return result;
        }

        /// <summary>
        /// The effective interface set and any base interfaces of those
        /// interfaces. This is AllInterfaces excluding interfaces that are
        /// only implemented by the effective base type.
        /// </summary>
        internal ImmutableArray<NamedTypeSymbol> AllEffectiveInterfacesNoUseSiteDiagnostics
        {
            get
            {
                return base.GetAllInterfaces();
            }
        }

        internal ImmutableArray<NamedTypeSymbol> AllEffectiveInterfacesWithDefinitionUseSiteDiagnostics(ref HashSet<DiagnosticInfo> useSiteDiagnostics)
        {
            var result = AllEffectiveInterfacesNoUseSiteDiagnostics;

            // Since bases affect content of AllInterfaces set, we need to make sure they all are good.
            var current = DeducedBaseType(ref useSiteDiagnostics);

            while ((object)current != null)
            {
                current = current.BaseTypeWithDefinitionUseSiteDiagnostics(ref useSiteDiagnostics);
            }

            foreach (var iface in result)
            {
                iface.OriginalDefinition.AddUseSiteDiagnostics(ref useSiteDiagnostics);
            }

            return result;
        }

        /// <summary>
        /// Called by <see cref="ConstraintTypesNoUseSiteDiagnostics"/>, <see cref="InterfacesNoUseSiteDiagnostics"/>, <see cref="EffectiveBaseClass"/>, and <see cref="DeducedBaseType"/>.
        /// to allow derived classes to ensure constraints within the containing
        /// type or method are resolved in a consistent order, regardless of the
        /// order the callers query individual type parameters.
C
Charles Stoner 已提交
370 371 372
        /// The `early` parameter indicates whether the constraints can be from
        /// the initial phase of constraint checking where the constraint types may
        /// still contain invalid or duplicate types.
P
Pilchie 已提交
373
        /// </summary>
C
Charles Stoner 已提交
374
        internal abstract void EnsureAllConstraintsAreResolved(bool early);
P
Pilchie 已提交
375 376 377 378

        /// <summary>
        /// Helper method to force type parameter constraints to be resolved.
        /// </summary>
C
Charles Stoner 已提交
379
        protected static void EnsureAllConstraintsAreResolved(ImmutableArray<TypeParameterSymbol> typeParameters, bool early)
P
Pilchie 已提交
380 381 382 383
        {
            foreach (var typeParameter in typeParameters)
            {
                // Invoke any method that forces constraints to be resolved.
C
Charles Stoner 已提交
384
                var unused = typeParameter.GetConstraintTypes(ConsList<TypeParameterSymbol>.Empty, early);
P
Pilchie 已提交
385 386 387
            }
        }

C
Charles Stoner 已提交
388
        internal abstract ImmutableArray<TypeSymbolWithAnnotations> GetConstraintTypes(ConsList<TypeParameterSymbol> inProgress, bool early);
P
Pilchie 已提交
389 390 391 392 393 394 395

        internal abstract ImmutableArray<NamedTypeSymbol> GetInterfaces(ConsList<TypeParameterSymbol> inProgress);

        internal abstract NamedTypeSymbol GetEffectiveBaseClass(ConsList<TypeParameterSymbol> inProgress);

        internal abstract TypeSymbol GetDeducedBaseType(ConsList<TypeParameterSymbol> inProgress);

C
Charles Stoner 已提交
396
        private bool ConstraintImpliesReferenceType(TypeSymbol constraint, ConsList<TypeParameterSymbol> inProgress)
P
Pilchie 已提交
397 398 399
        {
            if (constraint.TypeKind == TypeKind.TypeParameter)
            {
C
Charles Stoner 已提交
400 401
                var constraints = ((TypeParameterSymbol)constraint).GetConstraintTypesNoUseSiteDiagnostics(inProgress, early: true);
                return IsReferenceTypeFromConstraintTypes(constraints, inProgress);
P
Pilchie 已提交
402 403 404 405 406 407 408 409 410 411
            }
            else if (!constraint.IsReferenceType)
            {
                return false;
            }
            else
            {
                switch (constraint.TypeKind)
                {
                    case TypeKind.Interface:
412
                        return false; // can be satisfied by value types
P
Pilchie 已提交
413 414 415 416 417 418 419 420 421
                    case TypeKind.Error:
                        return false;
                }

                switch (constraint.SpecialType)
                {
                    case SpecialType.System_Object:
                    case SpecialType.System_ValueType:
                    case SpecialType.System_Enum:
422
                        return false; // can be satisfied by value types
P
Pilchie 已提交
423 424 425 426 427 428 429 430 431 432 433
                }

                return true;
            }
        }

        // From typedesc.cpp :
        // > A recursive helper that helps determine whether this variable is constrained as ObjRef.
        // > Please note that we do not check the gpReferenceTypeConstraint special constraint here
        // > because this property does not propagate up the constraining hierarchy.
        // > (e.g. "class A<S, T> where S : T, where T : class" does not guarantee that S is ObjRef)
C
Charles Stoner 已提交
434
        internal bool IsReferenceTypeFromConstraintTypes(ImmutableArray<TypeSymbolWithAnnotations> constraintTypes, ConsList<TypeParameterSymbol> inProgress)
P
Pilchie 已提交
435
        {
C
Charles Stoner 已提交
436
            return AnyConstraintTypes(constraintTypes, inProgress, (type, arg) => ConstraintImpliesReferenceType(type.TypeSymbol, arg));
P
Pilchie 已提交
437 438
        }

C
Charles Stoner 已提交
439
        internal bool IsValueTypeFromConstraintTypes(ImmutableArray<TypeSymbolWithAnnotations> constraintTypes, ConsList<TypeParameterSymbol> inProgress)
P
Pilchie 已提交
440
        {
C
Charles Stoner 已提交
441 442 443 444 445 446 447 448 449 450 451 452 453
            return AnyConstraintTypes(constraintTypes, inProgress, (type, arg) => type.GetIsValueType(arg));
        }

        private bool AnyConstraintTypes(
            ImmutableArray<TypeSymbolWithAnnotations> constraintTypes,
            ConsList<TypeParameterSymbol> inProgress,
            Func<TypeSymbolWithAnnotations, ConsList<TypeParameterSymbol>, bool> predicate)
        {
            if (constraintTypes.IsEmpty)
            {
                return false;
            }
            inProgress = inProgress.Prepend(this);
P
Pilchie 已提交
454 455
            foreach (var constraintType in constraintTypes)
            {
C
Charles Stoner 已提交
456
                if (predicate(constraintType, inProgress))
P
Pilchie 已提交
457 458 459 460 461 462 463
                {
                    return true;
                }
            }
            return false;
        }

C
Charles Stoner 已提交
464
        internal bool GetIsReferenceType(ConsList<TypeParameterSymbol> inProgress)
P
Pilchie 已提交
465
        {
C
Charles Stoner 已提交
466
            if (inProgress.ContainsReference(this))
P
Pilchie 已提交
467
            {
C
Charles Stoner 已提交
468 469 470 471 472
                return false;
            }
            if (this.HasReferenceTypeConstraint)
            {
                return true;
P
Pilchie 已提交
473
            }
C
Charles Stoner 已提交
474
            return IsReferenceTypeFromConstraintTypes(this.GetConstraintTypesNoUseSiteDiagnostics(inProgress, early: true), inProgress);
P
Pilchie 已提交
475 476
        }

C
Charles Stoner 已提交
477 478 479
        public sealed override bool IsReferenceType => GetIsReferenceType(ConsList<TypeParameterSymbol>.Empty);

        internal bool GetIsValueType(ConsList<TypeParameterSymbol> inProgress)
P
Pilchie 已提交
480
        {
C
Charles Stoner 已提交
481
            if (inProgress.ContainsReference(this))
P
Pilchie 已提交
482
            {
C
Charles Stoner 已提交
483
                return false;
P
Pilchie 已提交
484
            }
C
Charles Stoner 已提交
485 486 487 488 489
            if (this.HasValueTypeConstraint)
            {
                return true;
            }
            return IsValueTypeFromConstraintTypes(this.GetConstraintTypesNoUseSiteDiagnostics(inProgress, early: true), inProgress);
P
Pilchie 已提交
490 491
        }

C
Charles Stoner 已提交
492 493
        public sealed override bool IsValueType => GetIsValueType(ConsList<TypeParameterSymbol>.Empty);

P
Pilchie 已提交
494 495 496 497
        internal sealed override bool IsManagedType
        {
            get
            {
498
                return !this.HasUnmanagedTypeConstraint;
P
Pilchie 已提交
499 500 501
            }
        }

V
vsadov 已提交
502 503 504 505 506 507 508 509
        internal sealed override bool IsByRefLikeType
        {
            get
            {
                return false;
            }
        }

V
vsadov 已提交
510 511 512 513
        internal sealed override bool IsReadOnly
        {
            get
            {
514 515
                // even if T is indirectly constrained to a struct, 
                // we only can use members via constrained calls, so "true" would have no effect
V
vsadov 已提交
516 517 518 519
                return false;
            }
        }

P
Pilchie 已提交
520 521 522 523 524 525 526 527 528
        internal sealed override ObsoleteAttributeData ObsoleteAttributeData
        {
            get { return null; }
        }

        public abstract bool HasReferenceTypeConstraint { get; }

        public abstract bool HasValueTypeConstraint { get; }

529 530
        public abstract bool HasUnmanagedTypeConstraint { get; }

P
Pilchie 已提交
531 532 533 534 535 536 537
        public abstract VarianceKind Variance { get; }

        internal sealed override bool GetUnificationUseSiteDiagnosticRecursive(ref DiagnosticInfo result, Symbol owner, ref HashSet<TypeSymbol> checkedTypes)
        {
            return false;
        }

538
        internal override bool Equals(TypeSymbol t2, TypeCompareKind comparison)
P
Pilchie 已提交
539
        {
540
            return this.Equals(t2 as TypeParameterSymbol, comparison);
P
Pilchie 已提交
541 542 543 544
        }

        internal bool Equals(TypeParameterSymbol other)
        {
545
            return Equals(other, TypeCompareKind.ConsiderEverything);
P
Pilchie 已提交
546 547
        }

548
        private bool Equals(TypeParameterSymbol other, TypeCompareKind comparison)
P
Pilchie 已提交
549 550 551 552 553 554 555 556 557 558 559 560
        {
            if (ReferenceEquals(this, other))
            {
                return true;
            }

            if ((object)other == null || !ReferenceEquals(other.OriginalDefinition, this.OriginalDefinition))
            {
                return false;
            }

            // Type parameters may be equal but not reference equal due to independent alpha renamings.
561
            return other.ContainingSymbol.ContainingType.Equals(this.ContainingSymbol.ContainingType, comparison);
P
Pilchie 已提交
562 563 564 565 566 567 568
        }

        public override int GetHashCode()
        {
            return Hash.Combine(ContainingSymbol, Ordinal);
        }

569 570 571 572
        internal override void AddNullableTransforms(ArrayBuilder<bool> transforms)
        {
        }

573
        internal override bool ApplyNullableTransforms(ImmutableArray<bool> transforms, INonNullTypesContext nonNullTypesContext, ref int position, out TypeSymbol result)
574 575 576 577 578
        {
            result = this;
            return true;
        }

579
        internal override TypeSymbol SetUnknownNullabilityForReferenceTypes()
580 581 582 583
        {
            return this;
        }

P
Pilchie 已提交
584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
        #region ITypeParameterTypeSymbol Members

        TypeParameterKind ITypeParameterSymbol.TypeParameterKind
        {
            get
            {
                return (TypeParameterKind)this.TypeParameterKind;
            }
        }

        IMethodSymbol ITypeParameterSymbol.DeclaringMethod
        {
            get { return this.DeclaringMethod; }
        }

        INamedTypeSymbol ITypeParameterSymbol.DeclaringType
        {
            get { return this.DeclaringType; }
        }

        ImmutableArray<ITypeSymbol> ITypeParameterSymbol.ConstraintTypes
        {
            get
            {
608
                return this.ConstraintTypesNoUseSiteDiagnostics.SelectAsArray(c => (ITypeSymbol)c.TypeSymbol);
P
Pilchie 已提交
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637
            }
        }

        ITypeParameterSymbol ITypeParameterSymbol.OriginalDefinition
        {
            get { return this.OriginalDefinition; }
        }

        ITypeParameterSymbol ITypeParameterSymbol.ReducedFrom
        {
            get { return this.ReducedFrom; }
        }

        #endregion

        #region ISymbol Members

        public override void Accept(SymbolVisitor visitor)
        {
            visitor.VisitTypeParameter(this);
        }

        public override TResult Accept<TResult>(SymbolVisitor<TResult> visitor)
        {
            return visitor.VisitTypeParameter(this);
        }

        #endregion
    }
638
}