Description
We currently have a pile of Comparator combinators, all currently called comparing() or thenComparing().
These overloads have a problem: for implicit lambdas, we can't distinguish between
comparing(T->U)
and
comparing(T->int)
because we don't type-check the body of the lambda until we do overload selection, and don't do overload selection based on whether there are type errors in the body (this was roundly rejected as being too brittle). So for lambdas like:
comparing(x -> x.size())
we've got a circularity -- even under the older, more complex scheme.
These overloads have a problem: for implicit lambdas, we can't distinguish between
comparing(T->U)
and
comparing(T->int)
because we don't type-check the body of the lambda until we do overload selection, and don't do overload selection based on whether there are type errors in the body (this was roundly rejected as being too brittle). So for lambdas like:
comparing(x -> x.size())
we've got a circularity -- even under the older, more complex scheme.