Skip to content

Commit

Permalink
2004-05-30 Martin Baulig <martin@ximian.com>
Browse files Browse the repository at this point in the history
	* rootcontext.cs (RootContext.LookupType): Don't cache things if
	we're doing a silent lookup.  Don't try to lookup nested types in
	TypeManager.object_type (thanks to Ben Maurer).

2004-05-30  Martin Baulig  <martin@ximian.com>

	Committing a patch from Ben Maurer.

	* rootcontext.cs (RootContext.LookupType): Cache negative results.

svn path=/trunk/mcs/; revision=28521
  • Loading branch information
Martin Baulig committed May 31, 2004
1 parent 7af71bd commit d31c6ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 12 additions & 0 deletions mcs/mcs/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

* convert.cs: add a trivial cache for overload operator resolution.

2004-05-30 Martin Baulig <martin@ximian.com>

* rootcontext.cs (RootContext.LookupType): Don't cache things if
we're doing a silent lookup. Don't try to lookup nested types in
TypeManager.object_type (thanks to Ben Maurer).

2004-05-30 Martin Baulig <martin@ximian.com>

Committing a patch from Ben Maurer.

* rootcontext.cs (RootContext.LookupType): Cache negative results.

2004-05-29 Martin Baulig <martin@ximian.com>

* class.cs (IMethodData.ShouldIgnore): New method.
Expand Down
15 changes: 6 additions & 9 deletions mcs/mcs/rootcontext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,8 @@ static public Type LookupType (DeclSpace ds, string name, bool silent, Location
{
Type t;

if (ds.Cache.Contains (name)){
if (ds.Cache.Contains (name)) {
t = (Type) ds.Cache [name];
if (t != null)
return t;
} else {
//
// For the case the type we are looking for is nested within this one
Expand All @@ -529,7 +527,8 @@ static public Type LookupType (DeclSpace ds, string name, bool silent, Location
while (containing_ds != null){
Type current_type = containing_ds.TypeBuilder;

while (current_type != null) {
while (current_type != null &&
current_type != TypeManager.object_type) {
//
// nested class
//
Expand All @@ -546,16 +545,14 @@ static public Type LookupType (DeclSpace ds, string name, bool silent, Location
}

t = NamespaceLookup (ds, name, silent, loc);
if (t != null){
if (!silent)
ds.Cache [name] = t;
return t;
}
}

if (!silent)
if (t == null && !silent)
Report.Error (246, loc, "Cannot find type `"+name+"'");

return null;
return t;
}

// <summary>
Expand Down

0 comments on commit d31c6ef

Please sign in to comment.