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

CompileStatic: ListAssignment takes precedence over Coercion when statically compiling

    XMLWordPrintableJSON

Details

    Description

      Observed on 2.2.2, but maybe affects all releases. To reproduce:

      import groovy.transform.CompileStatic

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

      fails, but should succeed given List should be coerced to Boolean via asBoolean()

      Also see discussion at
      http://comments.gmane.org/gmane.comp.lang.groovy.user/64604

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: