diff options
author | Juerg Billeter <j@bitron.ch> | 2007-09-08 08:42:33 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2007-09-08 08:42:33 +0000 |
commit | 10a9816144951adc09061156b6a349ce0eae795a (patch) | |
tree | 3582f4dcfc547e9ad6b5c4b2aa421f12c6288482 /gobject | |
parent | d98e5eab8b7451a038a391ee1b2fedca33d9b538 (diff) | |
download | vala-10a9816144951adc09061156b6a349ce0eae795a.tar.gz |
report an error when trying to define a signal in a type not deriving from
2007-09-08 Juerg Billeter <j@bitron.ch>
* gobject/valacodegeneratorsignal.vala: report an error when trying to
define a signal in a type not deriving from GLib.Object
svn path=/trunk/; revision=590
Diffstat (limited to 'gobject')
-rw-r--r-- | gobject/valacodegeneratorsignal.vala | 7 |
1 files changed, 7 insertions, 0 deletions
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; |