]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girwriter: Make sure the default constructor is called new
authorJohn Carr <john.carr@unrouted.co.uk>
Wed, 2 Sep 2009 11:57:45 +0000 (12:57 +0100)
committerJohn Carr <john.carr@unrouted.co.uk>
Wed, 2 Sep 2009 11:57:45 +0000 (12:57 +0100)
codegen/valagirwriter.vala

index 98b2af287b48e98581ca57e77f2d65554ca6cf88..25ced90ed712a75474f9e9c030fbfd9473386bd7 100644 (file)
@@ -615,7 +615,13 @@ public class Vala.GIRWriter : CodeVisitor {
                }
 
                write_indent ();
-               stream.printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());
+
+               if (m == ((Class)m.parent_symbol).default_construction_method) {
+                       stream.printf ("<constructor name=\"new\" c:identifier=\"%s\"", m.get_cname ());
+               } else {
+                       stream.printf ("<constructor name=\"%s\" c:identifier=\"%s\"", m.name, m.get_cname ());
+               }
+
                if (m.tree_can_fail) {
                        stream.printf (" throws=\"1\"");
                }