Proposal to drop Weak Conformance from the language

I think Weak Conformance is a private case of potential implicit conversions use, and therefore we can widen the criteria where implicit conversions are applied to handle Weak Conformance and other cases.

Let’s consider the following example:

class Foo(val value : Int)
object Foo1 extends Foo(1)
object Foo2 extends Foo(2)

class Bar(val value : Int)
object Bar {
  implicit def toFoo(b : Bar) : Foo = new Foo(b.value)
}
object Bar1 extends Bar(1)

val list = List(Foo1, Foo2, Bar1, new Foo(3))

By current definition of Scala’s type inference, list : List[Object], since Object is the common ancestor of all these types. If we expand the implicit conversion rule, we can expect the compiler to apply the conversion from Bar to Foo to get a lower common ancestor, Foo.


Proposal (sorry, I’m not good at language formulation):
Given n T1...Tn types with common superclass T, implicit conversions can be applied to infer a lower superclass S under the following conditions:
For all i=(1...n) we have Ti <:< T and Ti !=:= T, and there are implicit conversions that bring all Ti to a common superclass S, so S <:< T and S !=:= T, and there is a Tj such that S =:= Tj.

If this proposal is applied, we can get rid of the Weak Conformance special case, and the user can choose not to have it by excluding predef('s implicit conversions).