summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--gobject/valacodegeneratorsignal.vala7
2 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 26d8f011e..51abe0439 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-08 Jürg Billeter <j@bitron.ch>
+
+ * gobject/valacodegeneratorsignal.vala: report an error when trying to
+ define a signal in a type not deriving from GLib.Object
+
2007-09-07 Jürg Billeter <j@bitron.ch>
* doc/vala/default.css, doc/vala/xhtml.xsl: support notes
diff --git a/gobject/valacodegeneratorsignal.vala b/gobject/valacodegeneratorsignal.vala
index ca393bfaf..9c320f9c5 100644
--- a/gobject/valacodegeneratorsignal.vala
+++ b/gobject/valacodegeneratorsignal.vala
@@ -105,6 +105,13 @@ public class Vala.CodeGenerator {
}
public override void visit_signal (Signal! sig) {
+ var dt = sig.parent_symbol as DataType;
+ if (!dt.is_subtype_of (gobject_type)) {
+ sig.error = true;
+ Report.error (sig.source_reference, "Only classes and interfaces deriving from GLib.Object support signals. `%s' does not derive from GLib.Object.".printf (dt.get_full_name ()));
+ return;
+ }
+
sig.accept_children (this);
string signature;