Defining a variable in scala with two implicits -
i came across interesting post on twitter scalalang. code compiles , works
class a(implicit implicit val b: int) val obja = new a()(42)
can please explain me how working? read documentation of implicits didn't found case this. please explain me what's happening here.
any appreciated !
you can have implicit
before last parameter list of class or method, , before member of class or trait. combines both, legal because forbidding make language specification , parser more complex no real benefit. don't think there reason ever use or difference writing implicit
once.
Comments
Post a Comment