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 599635 - dict get_keys no longer compiles
dict get_keys no longer compiles
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Genie
unspecified
Other Linux
: Normal blocker
: ---
Assigned To: Jamie McCracken
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-26 10:10 UTC by Barry Kauler
Modified: 2009-10-26 23:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Barry Kauler 2009-10-26 10:10:46 UTC
I am using vala from git, dated October 24, 2009.

This simple example in the Genie home page http://live.gnome.org/Genie no longer compiles:

[indent=4]

init
 
    /* test dicts */
    var d = new dict of string,string

    /* add or change entries with following */
    d["Genie"] = "Great"
    d["Vala"] = "Rocks"
    
    
    /* access entires using d[key] */
    for s in d.get_keys ()
        print "%s => %s", s, d[s]


Try to compile it:
prompt> valac --pkg=gee-1.0 example.gs
loops.gs:14.14-14.23: error: The name `get_keys' does not exist in the context of `Gee.HashMap<string,string>'
    for s in d.get_keys ()
             ^^^^^^^^^^
Compilation failed: 1 error(s), 0 warning(s)
Comment 1 Barry Kauler 2009-10-26 22:54:35 UTC
Nicolas has posted a response to this "bug" to my blog, reproduced here:

If you have updated the libgee, the bug n°1 is not a bug, but a change in the lib !
Use this:

[indent=4]

init

/* test dicts */
var d = new dict of string,string

/* add or change entries with following */
d["Genie"] = "Great"
d["Vala"] = "Rocks"


/* access entires using d[key] */
for s in d.keys
print "%s => %s", s, d[s] 

...so, Jamie, could you update the example on your Genie web page, then close this bug.

Note, it follows too that "d.values" works, confirmed.

Hey, I'm looking forward to when these sorts of things get frozen!

Thanks.
Regards,
Barry Kauler
Comment 2 Barry Kauler 2009-10-26 23:21:58 UTC
Okay, closing it.