public override FullNamedExpression LookupNamespaceOrType (string name, int arity, Location loc, bool ignore_cs0104)
{
FullNamedExpression e;
if (arity == 0 && Cache.TryGetValue (name, out e))
return e;
e = null;
int errors = Report.Errors;
if (arity == 0) {
TypeParameter[] tp = CurrentTypeParameters;
if (tp != null) {
TypeParameter tparam = TypeParameter.FindTypeParameter (tp, name);
if (tparam != null)
e = new TypeParameterExpr (tparam, Location.Null);
}
}
if (e == null) {
TypeSpec t = LookupNestedTypeInHierarchy (name, arity);
if (t != null)
e = new TypeExpression (t, Location.Null);
else if (Parent != null) {
e = Parent.LookupNamespaceOrType (name, arity, loc, ignore_cs0104);
} else
e = NamespaceEntry.LookupNamespaceOrType (name, arity, loc, ignore_cs0104);
}
// TODO MemberCache: How to cache arity stuff ?
if (errors == Report.Errors && arity == 0)
Cache[name] = e;
return e;
}