Skip to content

[2.13.0-M4] Keep the override on the symbolic operator #11009

@MasseGuillaume

Description

@MasseGuillaume

Let's say I implement a Map in 2.12. I need to override def - (key: K): C. If I bump the Scala version to 2.13, I now need to override the alphanumeric method remove(key: K): C.

https://github.com/scala/scala/blob/a0026305125dcc814097b1fbb798fe925ca9f81f/src/library/scala/collection/immutable/Map.scala#L59-L62

currently:

def remove(key: K): C
@`inline` final def - (key: K): C = remove(key)

I propose we keep the symbolic operator non-final for compatibility:

@`inline` final def remove(key: K): C = this - key
def - (key: K): C

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions