These are chat archives for non/algebra

18th
Dec 2015
Miles Sabin
@milessabin
Dec 18 2015 10:48

@milessabin
I've run into something very puzzling in Order in 2.10.5. When I add the Algebra definition (unchanged apart from the package name) to Cats I see the following on 2.10.5,

[info] Compiling 110 Scala sources to /home/miles/projects/cats/core/.jvm/target/scala-2.10/classes...
[error] /home/miles/projects/cats/core/src/main/scala/cats/Order.scala:37: discarded non-Unit value
[error]   def min(x: A, y: A): A = if (lt(x, y)) x else y
[error]       ^
[error] /home/miles/projects/cats/core/src/main/scala/cats/Order.scala:42: discarded non-Unit value
[error]   def max(x: A, y: A): A = if (gt(x, y)) x else y
[error]       ^
[error] two errors found

Which appears to be a manifestation of https://issues.scala-lang.org/browse/SI-8632
What I don't understand is how this is avoided in Algebra ... building the same source file (modulo package name) under 2.10.5 succeeds.
I've looked for Scala version variant source related to this in Algebra but not found anything.
Can anyone tell me what's going on?

Dale Wijnand
@dwijnand
Dec 18 2015 11:21
@milessabin -Ywarn-value-discard is disabled in algebra and enabled in cats (with -Yfatal-warnings): https://github.com/non/algebra/blob/23bf1748dfc5d5986aafa368f49597eb264b6cef/build.sbt#L27
Miles Sabin
@milessabin
Dec 18 2015 11:22
Ahh ... right!