From 40b90d2407c7fb655b5be10b0577f4c5dc3078e6 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Wed, 26 Mar 2014 02:20:58 +0100 Subject: [PATCH] generator: Add new keyword to GType property if it hides parent If the parent already has a GType property, add a "new" keywords to hide it. This eliminates a lot of warnings when using classes derived from Opaque. Closes issue #100. Signed-off-by: Bertrand Lorentz --- generator/Method.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/Method.cs b/generator/Method.cs index 80ae73c6d..d8859e95c 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -128,7 +128,7 @@ namespace GtkSharp.Generation { if (Name == "ToString" && Parameters.Count == 0 && (!(container_type is InterfaceGen)|| implementor != null)) sw.Write("override "); - else if (Name == "GetGType" && container_type is ObjectGen) + else if (Name == "GetGType" && (container_type is ObjectGen || (container_type.Parent != null && container_type.Parent.Methods.ContainsKey ("GetType")))) sw.Write("new "); else if (Modifiers == "new " || (dup != null && ((dup.Signature != null && Signature != null && dup.Signature.ToString() == Signature.ToString()) || (dup.Signature == null && Signature == null)))) sw.Write("new ");