GNOME Bugzilla – Bug 527770
`this` not working in struct creation methods
Last modified: 2008-05-09 09:10:04 UTC
It should be possible to access the struct under construction with the `this` expression.
Created attachment 110396 [details] [review] trivial patch Patch based on implementation of "this" in vala/valaclass.vala. Test case: using GLib; public class Test : Object { public static int main(string[] args) { Blah b = Blah(); stdout.printf("%d\n", b.i); // Expected: // 5 return 0; } } public struct Blah { public Blah () { this.i = 5; } public int i; }
Thanks for the patch.
2008-05-08 Jürg Billeter <j@bitron.ch> * vala/valastruct.vala: Support `this' in struct creation methods, patch by Jared Moore, fixes bug 527770 Fixed in r1349.