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
scala>Ambiguous.f(newX)
res2:Int=1
scala>Ambiguous.f(newY)
<console>:8:error: ambiguous reference to overloaded definition,
both method f in objectAmbiguous of type (ys: Y*)Int
and method f in objectAmbiguous of type (x: X)Intmatch argument types (Y)
Ambiguous.f(newY)
But the corresponding Java program works compiles:
edit: as pointed out by andrew (comment below), javac picks the first alternative in both cases.