scala - trying to print overridden toString method
<p>the bellow code :</p>

<pre><code>scala&gt; class A {
 |     def hi = "Hello from A"
 |     override def toString = getClass.getName
 | }
defined class A

scala&gt; val a = new A()
a: A = A

scala&gt; a.toString
res10: String = A

scala&gt; println(s"${a.toString}")
$line31.$read$$iw$$iw$A
</code></pre>

<p>It is printing ok when using <code>a.toString</code> expression, not when using <code>println(s"${a.toString}")</code>. The problem is <code>getClass.getName</code>. In other cases it works nice.</p>

<p>Thanks in advance for any help</p>