vala r1600 - in trunk: . gobject



Author: juergbi
Date: Mon Jun 16 20:56:20 2008
New Revision: 1600
URL: http://svn.gnome.org/viewvc/vala?rev=1600&view=rev

Log:
2008-06-16  JÃrg Billeter  <j bitron ch>

	* gobject/valaccodegenerator.vala:

	Report error when using reference counting for interfaces without
	class prerequisite


Modified:
   trunk/ChangeLog
   trunk/gobject/valaccodegenerator.vala

Modified: trunk/gobject/valaccodegenerator.vala
==============================================================================
--- trunk/gobject/valaccodegenerator.vala	(original)
+++ trunk/gobject/valaccodegenerator.vala	Mon Jun 16 20:56:20 2008
@@ -1284,6 +1284,10 @@
 			string dup_function;
 			if (type.data_type.is_reference_counting ()) {
 				dup_function = type.data_type.get_ref_function ();
+				if (type.data_type is Interface && dup_function == null) {
+					Report.error (source_reference, "missing class prerequisite for interface `%s'".printf (type.data_type.get_full_name ()));
+					return null;
+				}
 			} else if (cl != null && cl.is_immutable) {
 				// allow duplicates of immutable instances as for example strings
 				dup_function = type.data_type.get_dup_function ();
@@ -1379,6 +1383,10 @@
 			if (type is ReferenceType) {
 				if (type.data_type.is_reference_counting ()) {
 					unref_function = type.data_type.get_unref_function ();
+					if (type.data_type is Interface && unref_function == null) {
+						Report.error (type.source_reference, "missing class prerequisite for interface `%s'".printf (type.data_type.get_full_name ()));
+						return null;
+					}
 				} else {
 					unref_function = type.data_type.get_free_function ();
 				}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]