Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5899

withObject[Output|Input]Stream - auto detect 'it' type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.0-rc-1
    • 2.3.0-beta-1
    • Static Type Checker
    • None
    • groovy-2.1.0-rc-1

    Description

      This code works:

      new ByteArrayOutputStream().withObjectOutputStream { ObjectOutputStream oos -> oos << new Object()}

      but this one, doesn't:

      new ByteArrayOutputStream().withObjectOutputStream { it << new Object() }

      Exception:

      Cannot find matching method java.lang.Object#leftShift(java.lang.Object). Please check if the declared type is right and if the method exists.

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              cazacugmihai Cazacu Mihai
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: