]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error on unsupported constructor chain up
authorJürg Billeter <j@bitron.ch>
Sun, 16 Aug 2009 19:57:38 +0000 (21:57 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 16 Aug 2009 19:57:38 +0000 (21:57 +0200)
Fixes bug 581362.

vala/valamethodcall.vala

index a4763b81f73e525edd1cf2d9d9c99289c89c6fd5..5f9f9098a29243cba9418ad1fdde97dfa68129f0 100644 (file)
@@ -147,6 +147,15 @@ public class Vala.MethodCall : Expression {
                                return false;
                        }
                        cm.chain_up = true;
+
+                       var otype = (ObjectType) mtype;
+                       var cl = (Class) otype.type_symbol;
+                       var base_cm = cl.default_construction_method;
+                       if (!base_cm.has_construct_function) {
+                               error = true;
+                               Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+                               return false;
+                       }
                }
 
                // check for struct construction
@@ -178,6 +187,13 @@ public class Vala.MethodCall : Expression {
                                return false;
                        }
                        cm.chain_up = true;
+
+                       var base_cm = (CreationMethod) call.symbol_reference;
+                       if (!base_cm.has_construct_function) {
+                               error = true;
+                               Report.error (source_reference, "chain up to `%s' not supported".printf (base_cm.get_full_name ()));
+                               return false;
+                       }
                }
 
                Gee.List<FormalParameter> params;