posted 22 years ago
I'll try, but I do not feel 100% that I understand it myself; so beware.
The compiler must try to decide which of m(B, B) or m(A, C) is "most specific" to the actual call which is type m(C, C). If we choose the m(B, B) case we can object because the second argument is a C, so m(A, C) is "more specific". If we choose the m(A, C) case we can object because the first argument is a C which is a B, so m(B, B) is "more specific". Because we can object in both cases it cannot be decided which of the two methods to call.
When you change the m(A, C) to m(B, C) we can choose m(B, C) because the second argument is a C which is more "specific" than it being a B.
Is there some easy algorithm for resolving these things?
-Barry