In c# I can write code such as this (I ran it Linqpad 5):
void Main()
{
new Test { Property1 = 100 }.Dump();
Console.WriteLine(nameof(Test.Property1));
}
class Test
{
public int Property1 { get; set; }
override public String ToString()
{
return $"{nameof(Property1)}={Property1}";
}
}
Is there a scala equivalent of nameof?
Thanks