Open CowSmiles opened 3 years ago
Thanks for your awesome work.
I have a problem using nameof without having an instance of the type.
We can use the following way to get a field name
case class Person(name: String, age: Int) println(nameOf((_:Person).age)) // age println(nameOf[Person](_.age)) // age
But if I make (_:Person).age to a parameter, so we only get the parameter name, how can i get the real field name according the function:
(_:Person).age
val foo = (_:Person).age println(nameOf(foo)) // foo, but I want age println(nameOf[Person](foo)) // foo, but I want age
Thanks
I can say I have same issue - I'm trying to pass expr: T => Any into nameOf[T] and what I'm getting is name of parameter passed to it.
expr: T => Any
nameOf[T]
Thanks for your awesome work.
I have a problem using nameof without having an instance of the type.
We can use the following way to get a field name
But if I make
(_:Person).age
to a parameter, so we only get the parameter name, how can i get the real field name according the function:Thanks