My API prototype is as follows:
I have a third-party API object with a name ZResponseHandlerthat has a method
printZ(z:Z)
no I have the following:
case class X
case class Y
case class Z(x:X,y:Y)
now when i use my API calling printZ method with new instance of z, it works fine.
ZResponseHandler.printZ(new Z(x,y))
but I would like to create something like this:
implicit def convertXYtoZ(x:X,y:Y):Z = new Z(x,y)
ZResponseHandler.printZ(x,y)
this code gives me a compilation error - too many arguments for method printZ:
is there any way to make some implicit class that accept printZ (x, y)?
source
share