[vala/wip/attributes] fixup! Drop C specific methods from the code tree



commit c2393dd22d78d046cd099f91f5d31f7253d91bca
Author: JÃrg Billeter <j bitron ch>
Date:   Mon Aug 1 16:24:25 2011 +0200

    fixup! Drop C specific methods from the code tree

 vala/valaarraytype.vala |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/vala/valaarraytype.vala b/vala/valaarraytype.vala
index 6929aee..4bba50e 100644
--- a/vala/valaarraytype.vala
+++ b/vala/valaarraytype.vala
@@ -167,14 +167,16 @@ public class Vala.ArrayType : ReferenceType {
 	}
 
 	public override bool compatible (DataType target_type) {
-		if (target_type.data_type == CodeContext.get ().analyzer.gvalue_type.data_type && element_type.data_type == CodeContext.get ().root.scope.lookup ("string")) {
-			// allow implicit conversion from string[] to GValue
-			return true;
-		}
+		if (CodeContext.get ().profile == Profile.GOBJECT && target_type.data_type != null) {
+			if (target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvalue_type.data_type) && element_type.data_type == CodeContext.get ().root.scope.lookup ("string")) {
+				// allow implicit conversion from string[] to GValue
+				return true;
+			}
 
-		if (target_type.data_type == CodeContext.get ().analyzer.gvariant_type.data_type) {
-			// allow implicit conversion to GVariant
-			return true;
+			if (target_type.data_type.is_subtype_of (CodeContext.get ().analyzer.gvariant_type.data_type)) {
+				// allow implicit conversion to GVariant
+				return true;
+			}
 		}
 
 		if (target_type is PointerType || (target_type.data_type != null && target_type.data_type.get_attribute ("PointerType") != null)) {



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