]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
report error when using automatic properties in interfaces, fixes bug
authorJuerg Billeter <j@bitron.ch>
Wed, 30 Jan 2008 16:38:04 +0000 (16:38 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 30 Jan 2008 16:38:04 +0000 (16:38 +0000)
2008-01-30  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala: report error when using automatic
  properties in interfaces, fixes bug 513157

svn path=/trunk/; revision=930

ChangeLog
vala/valasemanticanalyzer.vala

index eae93c14e85103ea1c5fbd82f70823d3c470d0ce..b8e053c9edfc4c185f55d1678ba20f7d7e58f7e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-30  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valasemanticanalyzer.vala: report error when using automatic
+         properties in interfaces, fixes bug 513157
+
 2008-01-30  Jürg Billeter  <j@bitron.ch>
 
        * vala/valasemanticanalyzer.vala: report error when trying to add
index 806f611ea65165e30e6cc0eac6f925a8987d8703..11ecc822f27f2adc2205bb21d5ac6ebd497e514e 100644 (file)
@@ -637,7 +637,13 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
                if (!acc.source_reference.file.pkg) {
                        if (acc.body == null && !acc.prop.interface_only && !acc.prop.is_abstract) {
                                /* no accessor body specified, insert default body */
-                       
+
+                               if (acc.prop.parent_symbol is Interface) {
+                                       acc.error = true;
+                                       Report.error (acc.source_reference, "Automatic properties can't be used in interfaces");
+                                       return;
+                               }
+
                                acc.body = new Block ();
                                if (acc.readable) {
                                        acc.body.add_statement (new ReturnStatement (new MemberAccess.simple ("_%s".printf (acc.prop.name)), acc.source_reference));