Can you (or someone else) elaborate the downsides? I see them when converting
to Seq[Any]. But when we use the type inferencer and let it convert to the
mgu, everything should be fine. It's just like the inference when writing
Seq(...)
On Tue, Dec 4, 2012 at 7:36 AM, Sebastian Meßmer <ma...@smessmer.de> wrote:Can you (or someone else) elaborate the downsides? I see them when converting
to Seq[Any]. But when we use the type inferencer and let it convert to the
mgu, everything should be fine. It's just like the inference when writing
Seq(...)An implicit conversion always entails a loss of type-safety: that is their purpose. One can tolerate a loss of type-safety under some conditions; but this, a straight conversion between two widely used and inequivalent types, these are not the conditions. An implicit conversion in the default scope is something you inflict on everyone. I wouldn't want this one; I know plenty of other people wouldn't either. Tuples are tuples and sequences are sequences. The reason I use a language with types is so that either my tuples will stay tuples and my sequences will stay sequences, or the program won't compile.
You have the option to give that up if you want; as a default set of conditions, it does not fly, especially given that it's easy to add and hard to subtract. This argument applies equally well to some existing implicits; that's no reason to expand.A more concrete reason is that it would break a lot of code - for instance, it would break any program where such an implicit was already in place.
An implicit conversion always entails a loss of type-safety: that is their purpose. One can tolerate a loss of type-safety under some conditions; but this, a straight conversion between two widely used and inequivalent types, these are not the conditions. An implicit conversion in the default scope is something you inflict on everyone. I wouldn't want this one; I know plenty of other people wouldn't either.
That makes sense, thank you.
Sebastian
implicit class TypedProductIterator2[A](product2: Product2[_ <: A, _ <: A]) {