After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 656843 - assertion fails while using "owned" for value types, no error
assertion fails while using "owned" for value types, no error
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
0.12.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-18 18:25 UTC by Tal
Modified: 2014-07-15 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tal 2011-08-18 18:25:25 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.
Comment 1 Evan Nemerson 2014-06-27 05:41:09 UTC
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.
Comment 2 Tal 2014-07-15 16:21:18 UTC
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?
Comment 3 Evan Nemerson 2014-07-15 16:27:09 UTC
Yes.