You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.