You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Kousuke Saruta (Jira)" <ji...@apache.org> on 2020/01/18 19:19:00 UTC

[jira] [Created] (SPARK-30566) Iterator doesn't refer outer identifier named "iterator" properly in Scala 2.13

Kousuke Saruta created SPARK-30566:
--------------------------------------

             Summary: Iterator doesn't refer outer identifier named "iterator" properly in Scala 2.13
                 Key: SPARK-30566
                 URL: https://issues.apache.org/jira/browse/SPARK-30566
             Project: Spark
          Issue Type: Bug
          Components: Build
    Affects Versions: 3.0.0
         Environment: Scala 2.13
            Reporter: Kousuke Saruta


As of Scala 2.13, scala.collection.Iterator has "iterator" method so if an inner class of Iterator means to refer an outer identifier named "iterator", it does not work as we think.
Following is an example.

{code}
val iterator = ...

return new Iterator {

  def next() {
     iterator.next()         // this "iterator" is not what we defined above.
  }
}
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org