public FullNamedExpression LookupNamespaceOrType(string name, int arity, LookupMode mode, Location loc) { if (arity == 0) { var tp = CurrentTypeParameters; if (tp != null) { for (int i = 0; i < tp.Count; ++i) { var t = tp[i]; if (t.Name == name) { t.Type.DeclaredPosition = i; return(new TypeParameterExpr(t, loc)); } } } } return(host.Parent.LookupNamespaceOrType(name, arity, mode, loc)); }