public virtual ISymbolReference ToReference() { if (owner == null) { return(TypeParameterReference.Create(ownerType, index)); } return(new OwnedTypeParameterReference(owner.ToReference(), index)); }
/// <summary> /// Creates a type parameter reference. /// For common type parameter references, this method may return a shared instance. /// </summary> public static TypeParameterReference Create(SymbolKind ownerType, int index) { if (index >= 0 && index < 8 && (ownerType == SymbolKind.TypeDefinition || ownerType == SymbolKind.Method)) { TypeParameterReference[] arr = (ownerType == SymbolKind.TypeDefinition) ? classTypeParameterReferences : methodTypeParameterReferences; TypeParameterReference result = LazyInit.VolatileRead(ref arr[index]); if (result == null) { result = LazyInit.GetOrSet(ref arr[index], new TypeParameterReference(ownerType, index)); } return(result); } else { return(new TypeParameterReference(ownerType, index)); } }
public ITypeReference ToTypeReference() { return(TypeParameterReference.Create(this.OwnerType, this.Index)); }
public override ITypeReference ToTypeReference() { return(TypeParameterReference.Create(ownerType, index)); }