Commit 10a98161 authored by Jürg Billeter's avatar Jürg Billeter Committed by Jürg Billeter
Browse files

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
parent d98e5eab
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> 2007-09-07 Jürg Billeter <j@bitron.ch>
* doc/vala/default.css, doc/vala/xhtml.xsl: support notes * doc/vala/default.css, doc/vala/xhtml.xsl: support notes
......
...@@ -105,6 +105,13 @@ public class Vala.CodeGenerator { ...@@ -105,6 +105,13 @@ public class Vala.CodeGenerator {
} }
public override void visit_signal (Signal! sig) { 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); sig.accept_children (this);
string signature; string signature;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment