How to avoid "error: overloaded method ... with alternatives:"
<p>How do I define foo so that it works with any type that has a method math.max? The error states that max cannot be applied to (A,A). Well if A happens to be any of the types mentioned in the error then it can be and that is what I want. Isn't that the whole point of polymorphic type parameters? I even tried foo[A &lt;: Numeric] but got same error.</p>

<pre><code>scala&gt; def foo[A](a: A, b: A) = math.max(a,b)
&lt;console&gt;:9: error: overloaded method value max with alternatives:
(x: Double,y: Double)Double &lt;and&gt;
(x: Float,y: Float)Float &lt;and&gt;
(x: Long,y: Long)Long &lt;and&gt;
(x: Int,y: Int)Int
 cannot be applied to (A, A)
       def foo[A](a: A, b: A) = math.max(a,b)
</code></pre>