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

GroovyStrings are not always coerced to String

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-3
    • 1.0-beta-4
    • None
    • None

    Description

      import java.io.File

      dirname = 'dir'
      dir = new File("${dirname}") //this works
      println new File(dir, 'file10.txt') // this works
      number = 10
      println new File(dir, "file${number}.txt") // this fails

      It appears that GroovyString is coerced to String if it's the only parameter but not if it's one of several parameters.

      Attachments

        Activity

          People

            tug John Wilson
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: