title: Scala call single parameter method using space in anonymous class body
body: <p>In scala, how can I call a single parameter method using space in the body of the anonymous class?</p>
  <p><code>add &quot;Answer3&quot;</code> below is not working</p>
  <pre class="lang-scala prettyprint-override"><code>trait Question {
      def add(answer:String):Unit = {
          println(&quot;Received the answer=&quot; + answer)
      }
  }
  
  object Test {
      val question:Question = new Question {
          this add &quot;Answer1&quot; // working
  
          add(&quot;Answer2&quot;)     // working
          
          add &quot;Answer3&quot;      // NOT working, why? -&gt; error: ';' expected but string literal found.
      }
  }
  </code></pre>