var left = ResolveMemberName (context, mn.Left);
var ns = left as Namespace;
if (ns != null)
- return ns.Lookup (context, mn.Name, mn.Arity, Location.Null);
+ return ns.LookupTypeOrNamespace (context, mn.Name, mn.Arity, Location.Null);
TypeExpr texpr = left as TypeExpr;
if (texpr != null) {
if (fne != null) {
var ns = fne as Namespace;
if (ns != null) {
- fne = ns.Lookup (mc, ParsedName.Name, ParsedName.Arity, Location.Null);
+ fne = ns.LookupTypeOrNamespace (mc, ParsedName.Name, ParsedName.Arity, Location.Null);
if (fne != null) {
member = fne.Type;
}
Namespace ns = expr as Namespace;
if (ns != null) {
- FullNamedExpression retval = ns.Lookup (rc, Name, Arity, loc);
+ var retval = ns.LookupTypeOrNamespace (rc, Name, Arity, loc);
if (retval == null) {
ns.Error_NamespaceDoesNotExist (loc, Name, Arity, rc);
Namespace ns = expr_resolved as Namespace;
if (ns != null) {
- FullNamedExpression retval = ns.Lookup (rc, Name, Arity, loc);
+ FullNamedExpression retval = ns.LookupTypeOrNamespace (rc, Name, Arity, loc);
if (retval == null) {
ns.Error_NamespaceDoesNotExist (loc, Name, Arity, rc);
public virtual void Error_NamespaceDoesNotExist (Location loc, string name, int arity, IMemberContext ctx)
{
- FullNamedExpression retval = Lookup (ctx, name, -System.Math.Max (1, arity), loc);
+ var retval = LookupType (ctx, name, -System.Math.Max (1, arity), loc);
if (retval != null) {
Error_TypeArgumentsCannotBeUsed (ctx, retval.Type, arity, loc);
return;
return null;
}
- public FullNamedExpression Lookup (IMemberContext ctx, string name, int arity, Location loc)
+ public FullNamedExpression LookupTypeOrNamespace (IMemberContext ctx, string name, int arity, Location loc)
{
var texpr = LookupType (ctx, name, arity, loc);
//
// Check whether it's in the namespace.
//
- FullNamedExpression fne = ns.Lookup (this, name, arity, loc);
+ FullNamedExpression fne = ns.LookupTypeOrNamespace (this, name, arity, loc);
//
// Check aliases.