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

Improve smart type on list expresions

    XMLWordPrintableJSON

Details

    Description

      Probably code below should be compiled well in CompileStatic:

      def m() {
          def a  = 1
          Integer[] b = [a] // error: 'a' treats like an Object
      }
      

      and

      def m() {
           def row = ["", "", ""]
           def (left, right) = [row[0], row[1]]
           left.toUpperCase() // error: 'left' treats like an Object
      }
      

      Attachments

        Issue Links

          Activity

            People

              daniel_sun Daniel Sun
              Alexey Afanasiev Alexey Afanasiev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: