Example #1
0
 public ITypeParameter GetClassTypeParameter(int index)
 {
     if (index < ClassTypeParameters?.Count)
     {
         return(ClassTypeParameters[index]);
     }
     else
     {
         return(DummyTypeParameter.GetClassTypeParameter(index));
     }
 }
 public override IType VisitTypeParameter(ITypeParameter type)
 {
     if (type.OwnerType == SymbolKind.Method && ReplaceMethodTypeParametersWithDummy)
     {
         return(DummyTypeParameter.GetMethodTypeParameter(type.Index));
     }
     else if (type.OwnerType == SymbolKind.TypeDefinition && ReplaceClassTypeParametersWithDummy)
     {
         return(DummyTypeParameter.GetClassTypeParameter(type.Index));
     }
     else
     {
         return(base.VisitTypeParameter(type));
     }
 }
Example #3
0
 public override IType VisitTypeParameter(ITypeParameter type)
 {
     if (type.OwnerType == SymbolKind.Method && ReplaceMethodTypeParametersWithDummy)
     {
         return(DummyTypeParameter.GetMethodTypeParameter(type.Index));
     }
     else if (type.OwnerType == SymbolKind.TypeDefinition && ReplaceClassTypeParametersWithDummy)
     {
         return(DummyTypeParameter.GetClassTypeParameter(type.Index));
     }
     else if (RemoveNullability && type is NullabilityAnnotatedTypeParameter natp)
     {
         return(natp.TypeWithoutAnnotation.AcceptVisitor(this));
     }
     else
     {
         return(base.VisitTypeParameter(type));
     }
 }