Browse Source

Fixed the FindHierarchy to walk the declarations top-down instead of bottom-up, which is the expected behavior for the users of this method. This makes sure when searching for methods we find the one from the top classes first, instead of the base ones.

pull/1/head
triton 12 years ago
parent
commit
13b225e31e
  1. 6
      src/Bridge/Class.cs

6
src/Bridge/Class.cs

@ -207,15 +207,15 @@ namespace CppSharp @@ -207,15 +207,15 @@ namespace CppSharp
public IEnumerable<T> FindHierarchy<T>(Func<Class, IEnumerable<T>> func)
where T : Declaration
{
foreach (var elem in func(this))
yield return elem;
foreach (var @base in Bases)
{
if (!@base.IsClass) continue;
foreach(var elem in @base.Class.FindHierarchy<T>(func))
yield return elem;
}
foreach (var elem in func(this))
yield return elem;
}
public override T Visit<T>(IDeclVisitor<T> visitor)

Loading…
Cancel
Save