Browse Source

Fixed the check for duplicates to account for explicit impls. Fixed the getting of a root base method and property to consider the parameter for all bases.

Signed-off-by: Dimitar Dobrev <dpldobrev@yahoo.com>
pull/68/head
Dimitar Dobrev 12 years ago
parent
commit
ffbc5fbf15
  1. 4
      src/AST/Class.cs
  2. 10
      src/Generator/Passes/CheckDuplicatedNamesPass.cs

4
src/AST/Class.cs

@ -206,7 +206,7 @@ namespace CppSharp.AST @@ -206,7 +206,7 @@ namespace CppSharp.AST
public Method GetRootBaseMethod(Method @override, bool onlyFirstBase = false)
{
return (from @base in Bases
where !@base.Class.IsInterface
where !onlyFirstBase || !@base.Class.IsInterface
let baseMethod = (
from method in @base.Class.Methods
where
@ -224,7 +224,7 @@ namespace CppSharp.AST @@ -224,7 +224,7 @@ namespace CppSharp.AST
public Property GetRootBaseProperty(Property @override, bool onlyFirstBase = false)
{
return (from @base in Bases
where !@base.Class.IsInterface
where !onlyFirstBase || !@base.Class.IsInterface
let baseProperty = (
from property in @base.Class.Properties
where

10
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -31,6 +31,12 @@ namespace CppSharp.Passes @@ -31,6 +31,12 @@ namespace CppSharp.Passes
return UpdateName(method);
}
var property = decl as Property;
if (property != null && property.Parameters.Count > 0)
{
return false;
}
var count = Count++;
if (count == 0)
return false;
@ -93,7 +99,7 @@ namespace CppSharp.Passes @@ -93,7 +99,7 @@ namespace CppSharp.Passes
public override bool VisitProperty(Property decl)
{
if(!AlreadyVisited(decl))
if(!AlreadyVisited(decl) && decl.ExplicitInterfaceImpl == null)
CheckDuplicate(decl);
return false;
@ -104,7 +110,7 @@ namespace CppSharp.Passes @@ -104,7 +110,7 @@ namespace CppSharp.Passes
if (ASTUtils.CheckIgnoreMethod(decl))
return false;
if(!AlreadyVisited(decl))
if (!AlreadyVisited(decl) && decl.ExplicitInterfaceImpl == null)
CheckDuplicate(decl);
return false;

Loading…
Cancel
Save