public IType Resolve(ITypeResolveContext context)
 {
     if (ownerType == SymbolKind.Method)
     {
         IMethod method = context.CurrentMember as IMethod;
         if (method != null && index < method.TypeParameters.Count)
         {
             return(method.TypeParameters[index]);
         }
         return(DummyTypeParameter.GetMethodTypeParameter(index));
     }
     else if (ownerType == SymbolKind.TypeDefinition)
     {
         ITypeDefinition typeDef = context.CurrentTypeDefinition;
         if (typeDef != null && index < typeDef.TypeParameters.Count)
         {
             return(typeDef.TypeParameters[index]);
         }
         return(DummyTypeParameter.GetClassTypeParameter(index));
     }
     else
     {
         return(SpecialTypeSpec.UnknownType);
     }
 }
Example #2
0
 public override IType VisitTypeParameter(ITypeParameter type)
 {
     if (type.OwnerType == SymbolKind.Method)
     {
         return(DummyTypeParameter.GetMethodTypeParameter(type.Index));
     }
     else
     {
         return(base.VisitTypeParameter(type));
     }
 }