]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when declaring a compact class implementing an interface,
authorJuerg Billeter <j@bitron.ch>
Wed, 28 May 2008 16:25:28 +0000 (16:25 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Wed, 28 May 2008 16:25:28 +0000 (16:25 +0000)
2008-05-28  Juerg Billeter  <j@bitron.ch>

* vala/valasemanticanalyzer.vala:

Report error when declaring a compact class implementing an
interface, patch by Phil Housley

svn path=/trunk/; revision=1463

ChangeLog
vala/valasemanticanalyzer.vala

index 7301ba64df533f0cbe2fc922ac79af9824656943..ef1c9fc7d49595adf2549d984fc7e595db9e5e2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-05-28  Jürg Billeter  <j@bitron.ch>
+
+       * vala/valasemanticanalyzer.vala:
+
+       Report error when declaring a compact class implementing an
+       interface, patch by Phil Housley
+
 2008-05-28  Jürg Billeter  <j@bitron.ch>
 
        * vapi/glib-2.0.vapi: fix GTypeModule binding
index 7fcadbdd306d62a621389c60393059687ce377b0..3ffda90a36af4c71de4144c94f28f0504dd79074 100644 (file)
@@ -135,6 +135,16 @@ public class Vala.SemanticAnalyzer : CodeVisitor {
 
                cl.accept_children (this);
 
+               /* compact classes cannot implement interfaces */
+               if (cl.is_compact) {
+                       foreach (DataType base_type in cl.get_base_types ()) {
+                               if (base_type.data_type is Interface) {
+                                       cl.error = true;
+                                       Report.error (cl.source_reference, "compact classes `%s` may not implement interfaces".printf (cl.get_full_name ()));
+                               }
+                       }
+               }
+
                /* gather all prerequisites */
                Gee.List<TypeSymbol> prerequisites = new ArrayList<TypeSymbol> ();
                foreach (DataType base_type in cl.get_base_types ()) {