Using Scala "2.10.4", I have a implicit definition like this:
implicit class MyImplicits(val s: S) {
def ==>(relation: W):Option[List[S]] = {
getRelation(s,relation)
}
}
when I want to use it, following works fine:
import MyImplicits
val list1 = s ==>(w)
val value = list1.get
But when I write this I get error:
import MyImplicits
val value = s ==>(w).get
Error:(56, 67) value get is not a member of MyImplicits
val value = s ==>(w).get
^
What is the reason for this error and is there anyway to solve it?
That's because it applies get to (w) rather than to the whole expression.
Try this:
val value = (s ==>(w)).get
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With