Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-25075 Build and test Spark against Scala 2.13
  3. SPARK-30566

Iterator doesn't refer outer identifier named "iterator" properly in Scala 2.13

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • Build
    • None
    • Scala 2.13

    Description

      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.

      val iterator = ...
      
      return new Iterator {
      
        def next() {
           iterator.next()         // this "iterator" is not what we defined above.
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              sarutak Kousuke Saruta
              sarutak Kousuke Saruta
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: