GNOME Bugzilla – Bug 619546
object.notify["foo"].connect is not checked at compile-time
Last modified: 2010-05-27 18:44:15 UTC
Say I have declared a class with something like this: public class Postler.Messages : Gtk.TreeView { public string? selected_location { get; set; } So I can connect to changes of the property like this: messages.notify["selected-location"].connect ((object, pspec) => { The problem is, there is no compile-time error if I fail to type the property name. It will not give a runtime error either. Nothing will happen at all. And then I start wondering why my lambda isn't working. I would expect a runtime error if the property doesn't exist. I would want a non-string syntax, such as messages.notify.selected_location.connect which is what I tried but apparently doesn't work. Or alternatively messages.selected_location.connect which would also make sense to me. But Vala says "string has no such method".
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 615262 ***