I notice by chance that scala can infer the type of some method's parameter. But I don't understand the exact rule. Can someone explain me why the test1 method work and why the test2 method does not work
object Test {
def test1[A]: A => A = a => a
def test2[A]: A = a
}
I can't find a good title for my question since I don't understand what is happening in this two lines. Do you have any idea?