Don't allow invoking signals like methods
I heard from a lot of people that they tried to use a method from a gobject, but without noticing valac invoked the signal with the same name from a subclass. An example is if you want to call the method Gtk.Window.destroy()
, but because your object isn't properly casted, the signal Gtk.Widget.destroy
is invoked. There are other similar cases where it is really confusing because you expect the method to be called, but it isn't and the compiler doesn't warn about it or gives another information that the signal was used, which is incredibly hard to debug. Sometimes you even end up needing to look into the generated C code to find the mistake.
Currently there is the alternative Object.signal.emit()
. So maybe this should be made the only method to invoke signals, and deprecate the old method. But maybe also another syntax would be better, than emit()
. Something like Object::signal()
or something with some other characters.