Hi Lionel,
So, I think current best practice in Scala is to avoid using <%.
(A <% B) literally asks "is there an implicit conversion from M to N?"
which is a very specific question.
Right now the implicit from Long works for most cases, but as you've
seen it definitely won't work for this. I'm open to considering it,
but I would rather not be forced to add implicits from every possible
number type (e.g. Byte, Short, etc) just to support <%. Right now we
mainly support these kinds of implicit conversions to make working
with literals easier (e.g. x + 1).
Can you give an idea of what you're trying to accomplish here? Is your
V type intended to be a two-dimensional vector? A point? It's possible
that a different design is possible, e.g.
implicit class VOps[M](t: (M, M)) {
def toV(implicit c: ConvertableFrom[M]): V[Number] =
V(c.toNumber(t._1), c.toNumber(t._2))
}
Anyway, hopefully we can figure out something that works. I'm worried
that if we start trying to support every possible use of <% we will be
completely overwhelmed.
-- Erik