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); } }
public override IType VisitTypeParameter(ITypeParameter type) { if (type.OwnerType == SymbolKind.TypeDefinition) { return(DummyTypeParameter.GetClassTypeParameter(type.Index)); } else { return(base.VisitTypeParameter(type)); } }