These are chat archives for non/algebra

Dec 2015
Miles Sabin
Dec 18 2015 10:48

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
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
Dec 18 2015 11:21
@milessabin -Ywarn-value-discard is disabled in algebra and enabled in cats (with -Yfatal-warnings):
Miles Sabin
Dec 18 2015 11:22
Ahh ... right!