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 <bertrand.lorentz@gmail.com>
This commit is contained in:
parent
0563af1c25
commit
40b90d2407
1 changed files with 1 additions and 1 deletions
|
@ -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 ");
|
||||
|
|
Loading…
Reference in a new issue