Commit 3b909493 authored by Raffaele Sandrini's avatar Raffaele Sandrini Committed by Raffaele Sandrini

Add support for ownership transfer with properties using the HASH (#)

2007-09-20  Raffaele Sandrini  <raffaele@sandrini.ch>

	* vala/parser.y: Add support for ownership transfer with properties
	using the HASH (#) modifier e.g. public string!# foo { get; set; }

svn path=/trunk/; revision=623
parent 0f8c952b
2007-09-20 Raffaele Sandrini <raffaele@sandrini.ch>
* vala/parser.y: Add support for ownership transfer with properties
using the HASH (#) modifier. e.g. public string!# foo { get; set; }
2007-09-20 Raffaele Sandrini <raffaele@sandrini.ch>
* vapi/glib-2.0.vala: add G.HashTable.size ()
......
......@@ -3066,6 +3066,13 @@ property_declaration
{
ValaSourceReference *src;
/* HASH in property type context has the meaning of transferring
* ownership instead of taking it */
if (vala_type_reference_get_takes_ownership ($5)) {
vala_type_reference_set_transfers_ownership ($5, TRUE);
vala_type_reference_set_takes_ownership ($5, FALSE);
}
if (!vala_type_reference_get_is_weak ($5)) {
vala_type_reference_set_takes_ownership ($5, TRUE);
}
......@@ -3099,6 +3106,13 @@ property_declaration
{
ValaSourceReference *src;
/* HASH in property type context has the meaning of transferring
* ownership instead of taking it */
if (vala_type_reference_get_takes_ownership ($5)) {
vala_type_reference_set_transfers_ownership ($5, TRUE);
vala_type_reference_set_takes_ownership ($5, FALSE);
}
if (!vala_type_reference_get_is_weak ($5)) {
vala_type_reference_set_takes_ownership ($5, TRUE);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment