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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0-rc-1
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: Static Type Checker
    • Labels:
      None
    • Environment:
      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

              • Assignee:
                melix C├ędric Champeau
                Reporter:
                cazacugmihai Cazacu Mihai
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: