Closed
Description
Right now extension methods are translated to ordinary functions and can be called as such:
extension (s: String) {
def sayHello: String = s"Hello, $s"
}
"world".sayHello // Hello, world
sayHello("world") // Hello, world
Which limits its usage in libraries - for example, re-implementing scala.collectionStringOps
as extension functions will add tenths of useless functions to visible scope causing confusion and potential problems with overload resolution and compatibility.
Metadata
Metadata
Assignees
Labels
No labels