From: Rico Tzschichholz Date: Tue, 24 Apr 2018 19:00:20 +0000 (+0200) Subject: codewriter: Add 'new' to symbols if needed to match the original source X-Git-Tag: 0.41.90~159 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4a15250f696f634670623d2aa79ec9395d900ab9;p=thirdparty%2Fvala.git codewriter: Add 'new' to symbols if needed to match the original source https://bugzilla.gnome.org/show_bug.cgi?id=614686 --- diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala index b442bb239..4535f8873 100644 --- a/vala/valacodewriter.vala +++ b/vala/valacodewriter.vala @@ -562,6 +562,11 @@ public class Vala.CodeWriter : CodeVisitor { write_indent (); write_accessibility (c); + + if (c.hides) { + write_string ("new "); + } + write_string ("const "); write_type (c.type_reference); @@ -595,6 +600,10 @@ public class Vala.CodeWriter : CodeVisitor { write_indent (); write_accessibility (f); + if (f.hides) { + write_string ("new "); + } + if (f.binding == MemberBinding.STATIC) { write_string ("static "); } else if (f.binding == MemberBinding.CLASS) { @@ -770,6 +779,10 @@ public class Vala.CodeWriter : CodeVisitor { } write_string (" "); } else { + if (m.hides) { + write_string ("new "); + } + if (m.binding == MemberBinding.STATIC) { write_string ("static "); } else if (m.binding == MemberBinding.CLASS) { @@ -782,10 +795,6 @@ public class Vala.CodeWriter : CodeVisitor { write_string ("override "); } - if (m.hides) { - write_string ("new "); - } - if (m.coroutine) { write_string ("async "); } @@ -827,6 +836,10 @@ public class Vala.CodeWriter : CodeVisitor { write_indent (); write_accessibility (prop); + if (prop.hides) { + write_string ("new "); + } + if (prop.binding == MemberBinding.STATIC) { write_string ("static "); } else if (prop.is_abstract) { @@ -889,6 +902,10 @@ public class Vala.CodeWriter : CodeVisitor { write_indent (); write_accessibility (sig); + if (sig.hides) { + write_string ("new "); + } + if (sig.is_virtual) { write_string ("virtual "); }