title: When anonfun$1 becomes anonfun$m1$1 (or vice versa) in Scala?
body: <p>Can anyone explain why Scala gives two different names in the following cases? Why couldn't Scala give the same names in each case?! Is there some kind of consistency I don't know yet? It must be related to eta-expansion, right?</p>
  
  <pre><code>object A {
    val ms: Seq[String =&gt; String] = Seq(m1)
    def m1(s: String) = s
  }
  A.ms.map(m =&gt; m.getClass.getSimpleName)
  </code></pre>
  
  <p>The above gives <code>List(anonfun$1)</code> - note the name of the element - <code>anonfun$1</code> while the following gives <code>anonfun$m1$1</code>. Why?</p>
  
  <pre><code>object A {
    val ms: Seq[String =&gt; String] = Seq(m1)
    def m1: String =&gt; String = s =&gt; s
  }
  A.ms.map(m =&gt; m.getClass.getSimpleName)
  </code></pre>
  
  <p>Could I also ask for a simpler case to demonstrate the difference (perhaps without using <code>Seq</code>)?</p>