GNOME Bugzilla – Bug 656843
assertion fails while using "owned" for value types, no error
Last modified: 2014-07-15 16:27:09 UTC
This code is invalid in Vala syntax(this is a property): public (value_type) (name) { owned get { ... } } "owned" can be only used for referenced types(including pointers). However, Vala compiler doesn't recognize this error. In result, it gives this error: ** (valac:18522): CRITICAL **: vala_ccode_identifier_construct: assertion `_name != NULL' failed If owned were used incorrectly more than once, the error repeat for each one. Vala compiler shell recognize this and inform the user.
I get something like "error: The type `int` doesn't declare a GValue take function" for int. I'm closing as obsolete, but please reopen (with a full test case) if you can still reproduce this.
Very weird, but now when I test this both in version 0.12 and 0.18, no error is given. I had an error back than, but since so much time has passed, I can't remeber the code& ValaC version that I used. However, both in 0.12 and 0.18 this test case passes(which it shouldn't?): using GLib; class Test { public int some_property { owned get { return 1; } } } void main() { } Is this code makes the error you mentioned in newer versions of ValaC?
Yes.