Browse Source

Fix comparison of char and const char* in overloading

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1261/head
Dimitar Dobrev 6 years ago
parent
commit
ed6f8f1f96
  1. 8
      src/Generator/Passes/CheckDuplicatedNamesPass.cs
  2. 2
      tests/Common/Common.Tests.cs

8
src/Generator/Passes/CheckDuplicatedNamesPass.cs

@ -123,13 +123,9 @@ namespace CppSharp.Passes @@ -123,13 +123,9 @@ namespace CppSharp.Passes
if (CheckForSpecializations(leftPointee, rightPointee))
return true;
if (leftPointee != null && rightPointee != null &&
return leftPointee != null && rightPointee != null &&
leftPointee.GetMappedType(TypeMaps, GeneratorKind).Equals(
rightPointee.GetMappedType(TypeMaps, GeneratorKind)))
return true;
return (leftPointee != null && leftPointee.Desugar(false).Equals(right)) ||
(rightPointee != null && rightPointee.Desugar(false).Equals(left));
rightPointee.GetMappedType(TypeMaps, GeneratorKind));
}
private static bool CheckForSpecializations(Type leftPointee, Type rightPointee)

2
tests/Common/Common.Tests.cs

@ -528,7 +528,7 @@ public class CommonTests : GeneratorTestFixture @@ -528,7 +528,7 @@ public class CommonTests : GeneratorTestFixture
Assert.That(prop.StartWithVerb, Is.EqualTo(25));
prop.StartWithVerb = 5;
Assert.That(prop.Contains('a'), Is.EqualTo(prop.Contains1("a")));
Assert.That(prop.Contains('a'), Is.EqualTo(prop.Contains("a")));
}
using (var prop = new HasOverridenSetter())
{

Loading…
Cancel
Save