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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -