Predef.any2stringadd
ile ilgili sorun yaşıyorum ne yazık ki officially considered not a PITA. Bir tür sınıf yaklaşımıVapourise Predef.any2stringadd yorumlayıcıda
object Foo {
implicit def fooOps(f: Foo): Ops = new Ops(f)
final class Ops(f: Foo) {
def +(that: Foo): Foo = ???
}
}
trait Foo
için
trait Foo {
def +(that: Foo): Foo
}
benim API değişti Şimdi o korkunç yöntem böyle bir kod derlenmiş gizleyebilirsiniz:
import Predef.{any2stringadd => _}
Ancak bu başarısız REPL/tercüman ortamımda.
val in = new IMain(settings, out)
in.addImports("Predef.{any2stringadd => _}") // has no effect?
Tercümana bu sinir bozucu yöntemi anlatması için nasıl söyleyebilirim?
object Foo {
// implicit def fooOps(f: Foo): Ops = new Ops(f)
final class Ops(f: Foo) {
def +(that: Foo): Foo = ???
}
}
trait Foo
implicit def fooOps(f: Foo): Foo.Ops = new Foo.Ops(f)
bilmiyorum iken: