How does the Enumeration.Value of a scala enumeration knows the name of the member? -


in scala, can create enumeration this:

object weekday extends enumeration {   val monday, tuesday = value } 

you can call tostring() name of member @ runtime

val name = weekday.monday.tostring // name = "monday" 

how possible? value method creates new object time, how can method access name of declared member without of compiler? pure scala magic me.


Comments

Popular posts from this blog

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -