Please take a look at this function in Scala and tell me why it doesn't compile.
def alternative_identity[A <: Any, B <: Any](obj: A): B = { obj } I know that the function itself doesn't make sense, however I am trying to solve more complex problem and this example illustrates the fundamental problem which I have. Thank you in advance!
Bis? The function is supposed to returnB, but it's returningA. Are they supposed to have the same type? What is the function supposed to do?alternative_identity[Int, Process](1)? How on earth will anIntmagically become aProcess?