From ed6f8f1f967794044f5db16d5cd2c6348fb887e3 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Wed, 18 Sep 2019 02:14:42 +0300 Subject: [PATCH] Fix comparison of char and const char* in overloading Signed-off-by: Dimitar Dobrev --- src/Generator/Passes/CheckDuplicatedNamesPass.cs | 8 ++------ tests/Common/Common.Tests.cs | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index a372373f..1400f3a2 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -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) diff --git a/tests/Common/Common.Tests.cs b/tests/Common/Common.Tests.cs index 51ef73f3..c0687da2 100644 --- a/tests/Common/Common.Tests.cs +++ b/tests/Common/Common.Tests.cs @@ -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()) {