spire
spire copied to clipboard
Int enhancement method /% does not work
I would expect /% to work on Int, but it doesn't. If this is not meant to work in the first place, feel free to close this issue.
There should be syntax tests for stuff like this, since it is quite easy to break things with ambiguous implicits.
scala> import spire.implicits._
scala> 3 /% 2
<console>:14: error: type mismatch;
found : Int(3)
required: ?{def /%(x$1: ? >: Int(2)): ?}
Note that implicit conversions are not applicable because they are ambiguous:
both method literalIntEuclideanRingOps in trait EuclideanRingSyntax of type (lhs: Int)spire.syntax.LiteralIntEuclideanRingOps
and method literalIntOps in trait IntSyntax of type (n: Int)spire.syntax.std.LiteralIntOps
are possible conversion functions from Int(3) to ?{def /%(x$1: ? >: Int(2)): ?}
3 /% 2
^
<console>:14: error: value /% is not a member of Int
3 /% 2
^
The literalInt convenience syntax gives ambiguous implicits in many cases --- I had problems when creating a MatrixRing[Mat[Int], Int] typeclass.
Why not create a branch with failing tests, where this case and others could be added, before discussing about possible solutions?