Is there in scala the equivalent of the c# nameof?

Viewed 979

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

2 Answers
Related