When I grab gala source either from GitHub or from apt source gala I get version 3.3.2 and when I run ninja to build it I get this error:

../src/Background/BackgroundSource.vala:123.17-123.34: error: The name `changed' does not exist in the context of `Gee.Map.Entry<int,Gala.Background>'
                background.changed.disconnect (background_changed);
../src/Background/BackgroundSource.vala:124.17-124.34: error: The name `destroy' does not exist in the context of `Gee.Map.Entry<int,Gala.Background>'
                background.destroy ();

Looking closer, I change this line:

foreach (var background in backgrounds) {

To this line:

foreach (var background in backgrounds.values) {

And it compiles and works fine. But, I do not understand why this package fails to compile for me but obviously works for others and presumably the build system as well?


I solved this mystery. It's related to #869 which is a fix that happened shortly after 3.3.2.

At the time the 3.3.2 build was made the vala version itself was different, so this code compiled at the time because vala was doing some additional checks on the foreach iterable and doing some form of type inference. This explains why there is no version of libgee itself that has ever exposed the default iterable of HashMap to be anything but Map.Entry, but why the code did compile without this hack in the past.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.