After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 619546 - object.notify["foo"].connect is not checked at compile-time
object.notify["foo"].connect is not checked at compile-time
Status: RESOLVED DUPLICATE of bug 615262
Product: vala
Classification: Core
Component: Objects
0.8.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-24 19:30 UTC by Christian Dywan
Modified: 2010-05-27 18:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Dywan 2010-05-24 19:30:48 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".
Comment 1 Luca Bruno 2010-05-27 18:44:15 UTC
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 ***