GNOME Bugzilla – Bug 666035
[patch] [feature request] infer enum scope from expected type
Last modified: 2017-11-19 19:41:50 UTC
Created attachment 203303 [details] [review] allow unscoped enum values In some cases, the scope for an enumeration value can be determined from the scope. In that case, it can save a lot of typing to be able to write A.bind_property("prop", B, "prop", SYNC_CREATE|BIDIRECTIONAL); and not having to specify the scope GLib.BindingFlags: A.bind_property("prop", B, "prop", GLib.BindingFlags.SYNC_CREATE|GLib.BindingFlags.BIDIRECTIONAL); This patch takes care of that.
Created attachment 203304 [details] test cases Here's a couple of testcases I used to verify that the patch works. There's probably too few regression tests (only one), but I cannot think of many.
Created attachment 361692 [details] [review] vala: Allow unscoped enum values where possible If the scope for an enumeration value can be determined from current context it is possible to omit the enum's scope, like for GLib.BindingFlags: Foo.bind_property("prop", Bar, "prop", SYNC_CREATE | BIDIRECTIONAL);
Created attachment 364010 [details] [review] vala: Allow unscoped enum values where possible If the scope for an enumeration value can be determined from current context it is possible to omit the enum's scope. Based on patch by Timo Kluck
Attachment 364010 [details] pushed as 33c91a0 - vala: Allow unscoped enum values where possible