GNOME Bugzilla – Bug 741467
Default constructor for SimpleType structs
Last modified: 2017-03-09 21:23:13 UTC
I think that simpletype structs should have a default constructor, which should do nothing, but initialize the local variable with 0s. ``` [SimpleType] public struct MyTest { int foo; int bar; } public void main() { MyTest foo = MyTest (); } iface.vala:8.15-8.23: error: `MyTest' does not have a default constructor ``` The way to initialize those structs is the following: MyTest foo = {0,0}; This is just a simple struct and this makes no problem, but, if the struct you want to initialize have 80 fields, with some of them of other kinds, you have to specify every single field by hand. Which is tedious and unnecessary because most of the time, structs will be initialized to zero, and then filled some fields progressively. I think that simpletype structs should have a default constructor.
See https://bugzilla.gnome.org/show_bug.cgi?id=616600 . Don't remember why I choose that path, but there must be a reason. This issue makes it go backward.
*** This bug has been marked as a duplicate of bug 741466 ***