]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Check for structs without fields, patch by Jared Moore, fixes bug 543562
authorJürg Billeter <j@bitron.ch>
Tue, 16 Sep 2008 13:59:58 +0000 (13:59 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Tue, 16 Sep 2008 13:59:58 +0000 (13:59 +0000)
2008-09-16  Jürg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala:

Check for structs without fields, patch by Jared Moore,
fixes bug 543562

svn path=/trunk/; revision=1775

ChangeLog
vala/valasemanticanalyzer.vala

index 8b25b9c323d79aa4bbce3ab72bfa870dc3c67817..8cf02c08532f4e6959cfaa79f5579f66d21defce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-09-16  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valasemanticanalyzer.vala:
+
+       Check for structs without fields, patch by Jared Moore,
+       fixes bug 543562
+
 2008-09-16  Jürg Billeter  <j@bitron.ch>
 
        * vapi/enchant.vapi:
index 6ef08fd26518361d069ab5813b4bee9586c386e9..1d99fd445c0dce3027c02bf6d78fa03a790a40cb 100644 (file)
@@ -318,6 +318,10 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                st.accept_children (this);
 
+               if (!st.external && st.get_base_types ().size == 0 && st.get_fields ().size == 0) {
+                       Report.error (st.source_reference, "structs cannot be empty");
+               }
+
                current_symbol = current_symbol.parent_symbol;
                current_struct = null;
        }