vala r1575 - in trunk: . vala



Author: juergbi
Date: Fri Jun 13 11:43:35 2008
New Revision: 1575
URL: http://svn.gnome.org/viewvc/vala?rev=1575&view=rev

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

	* vala/valastruct.vala:

	Implement is_subtype_of method so that structs are considered
	compatible to the specified base type


Modified:
   trunk/ChangeLog
   trunk/vala/valastruct.vala

Modified: trunk/vala/valastruct.vala
==============================================================================
--- trunk/vala/valastruct.vala	(original)
+++ trunk/vala/valastruct.vala	Fri Jun 13 11:43:35 2008
@@ -532,4 +532,18 @@
 			}
 		}
 	}
+
+	public override bool is_subtype_of (TypeSymbol t) {
+		if (this == t) {
+			return true;
+		}
+
+		foreach (DataType base_type in base_types) {
+			if (base_type.data_type != null && base_type.data_type.is_subtype_of (t)) {
+				return true;
+			}
+		}
+		
+		return false;
+	}
 }



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