Scala: type mismatch found :(Int, Int) => Int required: Ordering[Int]


#1

Hi @dgadiraju,

       I am new to scala. I am preparing one project while builiding the project the following code snippet is throwing error.

private def currentOrd: Ordering[Int] =
if (isAscending) {(x: Int, y: Int) => x + y}
else {(x: Int, y: Int) => y - x}

The error is : type mismatch found :(Int, Int) => Int required: Ordering[Int]

Could you please help me to resolve