I've approached a problem with scala implicits and I am posting a simplified version here.
I have a class called SomeClass that contains a implicit val a = 3;
I have a created a trait that I intend to use with SomeClass like below:
trait TestSum {
def sum(a:Int)(b:Int)(implicit c: Int): Unit = {
a + b + c
}
val sum_a = sum(1) _
}
Sum_a obviously will not work, because it requires an implicit value c, which is accessible in SomeClass scope. Moving sum_a to SomeClass solves the issue but messes a bit in my code. Is there any good solution to this?