]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codewriter: Add 'new' to symbols if needed to match the original source
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 24 Apr 2018 19:00:20 +0000 (21:00 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 24 Apr 2018 19:18:07 +0000 (21:18 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=614686

vala/valacodewriter.vala

index b442bb239b9bed9ccabb5a32eac75a0bd46325b7..4535f88739bb2cec47cde1bce648d65d0d4ec379 100644 (file)
@@ -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 ");
                }