I’ve had a hard time figuring out what problem this fixes, and we’ve discussed this at https://gitter.im/lampepfl/dotty?at=5939666a142826e972968625.
I suspect the scenario where this is most problematic is the one in this thread:
In general, given def ===[A](v1 : A, v2: A): Boolean = ...
, inverse conversions from A
to B
and from B
to A
, and variables a : A
and b : B
, what does a === b
mean?
Overall, I suspect an actual linter/compiler warning/error for such inverse conversions might be a better goal. But I wouldn’t know right away how to specify when to give this warning, if the conversions are more generic, so it’s not obvious how to achieve this goal.