eclipse-archived/ceylon

Remove upper bound constraint on `Map.mapItems()`

Closed this issue · 3 comments

mapItems() is:

Map<Key,Result> mapItems<Result>(Result mapping(Key key, Item item))
        given Result satisfies Object

but the constraint given Result satisfies Object seems overly restrictive now that Maps can contain null items.

The constraint rules out useful things like using mapItems() to help build a map-view of an object which may have nullable attributes.

In the Ceylon source this is:

given Result satisfies Object //TODO: remove this constraint!

And the only reason it has not been done is that it's a breaking change.

Ok. I second @quintesse's idea that we should have some way to tag issues that involve breaking changes.

Done, finally.