Skip to content

Ignored upper bound of type parameter #2888

Closed
@julienrf

Description

@julienrf

In scala/collection-strawman, this line gives the following compilation error:

def removeAll(keys: IterableOnce[K]): C = fromSpecificIterable(keys.iterator().foldLeft[CC[K, V]](coll)(_ - _))
                                                                                                        ^^^
                                 value `-` is not a member of CC[K, V]

Though CC is upper bounded by MapOps (see here), which provides the - operation. Note that the CC upper bound is recursive.

This code compiles fine with Scala 2.12 and 2.13.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions