From 4f574845fa1056de0e23f5fe3ec7ca86b583f428 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Fri, 9 Oct 2015 20:23:14 +0300 Subject: [PATCH] Made interface impls contain the interface as their original name-space. Signed-off-by: Dimitar Dobrev --- src/AST/Declaration.cs | 1 + src/Generator/Passes/MultipleInheritancePass.cs | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/AST/Declaration.cs b/src/AST/Declaration.cs index 48ae69fa..de143b79 100644 --- a/src/AST/Declaration.cs +++ b/src/AST/Declaration.cs @@ -328,6 +328,7 @@ namespace CppSharp.AST : this() { Namespace = declaration.Namespace; + OriginalNamespace = declaration.OriginalNamespace; OriginalName = declaration.OriginalName; name = declaration.Name; Comment = declaration.Comment; diff --git a/src/Generator/Passes/MultipleInheritancePass.cs b/src/Generator/Passes/MultipleInheritancePass.cs index 25ede4ed..e4d4cb45 100644 --- a/src/Generator/Passes/MultipleInheritancePass.cs +++ b/src/Generator/Passes/MultipleInheritancePass.cs @@ -199,7 +199,12 @@ namespace CppSharp.Passes m.Parameters.SequenceEqual(method.Parameters.Where(p => !p.Ignore), parameterTypeComparer))) continue; - var impl = new Method(method) { Namespace = @class, OriginalFunction = method.OriginalFunction }; + var impl = new Method(method) + { + Namespace = @class, + OriginalNamespace = @interface, + OriginalFunction = method.OriginalFunction + }; var rootBaseMethod = @class.GetBaseMethod(method, true); if (rootBaseMethod != null && rootBaseMethod.IsDeclared) impl.ExplicitInterfaceImpl = @interface; @@ -213,7 +218,7 @@ namespace CppSharp.Passes { foreach (var property in @interface.Properties.Where(p => p.Name != Helpers.InstanceIdentifier)) { - var impl = new Property(property) { Namespace = @class }; + var impl = new Property(property) { Namespace = @class, OriginalNamespace = @interface }; var rootBaseProperty = @class.GetBaseProperty(property, true); if (rootBaseProperty != null && rootBaseProperty.IsDeclared) impl.ExplicitInterfaceImpl = @interface;