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

Static compiler doesn't coerce GString for getAt() call

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.0-beta-1, 2.4.0-rc-1
    • Fix Version/s: None
    • Component/s: Static compilation
    • Labels:
      None

      Description

      This might not be a bug, but it's a behaviour change from 2.2.

      @groovy.transform.CompileStatic
      class OtherThing {
          OtherThing() {
              Map<String, String> m = [:]
              def k = "foo"
              m["$k"].toUpperCase() // fails, no method toUpperCase() on object
              m[k].toUpperCase() // works
          }
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ldaley Luke Daley
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: