[Vala] Accessing properties of a Map.Entry from a read-only Gee map causes compiler warning



I have the following map declaration:

Map<GB.Model.Date, Gee.List<Transaction>> transactions_by_date = new
HashMap<GB.Model.Date, Gee.List<Transaction>> ();

Then I iterate over its entries:

foreach (Map.Entry<GB.Model.Date, Gee.List<Transaction>> entry in
transactions_by_date.entries) {

    // ...
    // ...

}

Within this loop, whenver I access entry.key or entry.value, I get the
following compiler warning:

src/ui/tree_store_transaction.vala:284:14: warning: assignment discards
‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
                         debug ("transaction group: %s (%d
transaction(s))", entry.key.to_string (), entry.value.size);

I get this warning for each line accessing properties of the "entry"
variable. Is this normal?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]