title: How to invoke map() from a ProductIterator (Tuple)
body: <p>Given following placeholder logging method:</p>
  
  <pre><code>def testshow(value: Any) = value.toString
  </code></pre>
  
  <p>In the following code snippet:</p>
  
  <pre><code>  case t : Product =&gt;
      t.productIterator.foreach( a =&gt; println(a.toString))
       val lst =  t.productIterator.map(a =&gt; testshow(a))
       val lst2 = t.productIterator.map(_.toString)
        lst.mkString("(",",",")")
        lst2.mkString("(",",",")")
  </code></pre>
  
  <p>And given an input tuple :</p>
  
  <pre><code>(Some(OP(_)),Some(a),1)
  </code></pre>
  
  <p>The println successfully shows entries for the given tuple.</p>
  
  <pre><code>Some(OP(_))
  Some(a)
  1
  </code></pre>
  
  <p>lst2 (with toString) says:  Non-empty iterator.  However the  list "lst" says:</p>
  
  <pre><code>empty iterator
  </code></pre>
  
  <p>So what is wrong with the syntax to invoke the map() method on the productIterator?</p>
  
  <p>Note: if putting "toString" in place of testshow this works properly.</p>
  
  <p>Update: A "self contained" snippet does work.  It is still not clear why the above code does not..</p>
  
  <pre><code>def testshow(value: Any) = "TestShow%s".format(value.toString)
  
  val obj = ("abc",123,"def")
  obj match {
    case t : Product =&gt;
      t.productIterator.foreach( a =&gt; println(a.toString))
      val lst =  t.productIterator.map(a =&gt; testshow(a))
      val lst2 = t.productIterator.map(_.toString)
      println("testshow list %s".format(lst.mkString("(",",",")")))
      println("toString list %s".format(lst2.mkString("(",",",")")))
    }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>abc
  123
  def
  testshow list (**abc**,**123**,**def**)
  toString list (abc,123,def)
  </code></pre>