]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Add type check in property vfunc
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 27 Aug 2011 07:49:29 +0000 (09:49 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 27 Aug 2011 07:49:37 +0000 (09:49 +0200)
Fixes bug 657481.

codegen/valaccodebasemodule.vala

index 70a5e68bef34fbf45ffdf7022258ee4a0624ef5c..a62c6eae5ab725855ad7bca8b7f78decb21966ca 100644 (file)
@@ -1499,6 +1499,14 @@ public abstract class Vala.CCodeBaseModule : CodeGenerator {
 
                        push_function (function);
 
+                       if (prop.binding == MemberBinding.INSTANCE) {
+                               if (!acc.readable || returns_real_struct) {
+                                       create_property_type_check_statement (prop, false, t, true, "self");
+                               } else {
+                                       create_property_type_check_statement (prop, true, t, true, "self");
+                               }
+                       }
+
                        CCodeFunctionCall vcast = null;
                        if (prop.parent_symbol is Interface) {
                                var iface = (Interface) prop.parent_symbol;