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

CompileStatic: ListAssignment for String takes precendence over Coercion when statically compiling

    XMLWordPrintableJSON

Details

    Description

      May or may not be a bug, to be decided.
      Also see http://jira.codehaus.org/browse/GROOVY-6802

      To reproduce:

      import groovy.transform.CompileStatic

      @CompileStatic
      class Foo {
        def static main(String[] args) {
          String b = ["foo"]
          assert b == "[foo]"
        }
      }

      Assumption: This should succeed, List probably should be coerced into String via toString() as is done without @CompileStatic.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              tkruse Thibault Kruse
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: