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

Static type checking failure for streams and spread operator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.4.10
    • 4.0.1
    • Static Type Checker
    • None
    • Windows 7, JDK 1.8.0_66

    Description

      Input files:

      Test.groovy

      class Test {
          static void main(String[] args) {
              [1, 2, 3].stream()*.toString()
          }
      }
      

      compiler-config.groovy

      import groovy.transform.CompileStatic
      withConfig(configuration) {
          ast(CompileStatic)
      }
      

      Error:(3, 9) Groovyc: [Static type checking] - Spread operator can only be used on collection types

      Expected: static type checking allows spread operator for streams

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              ichulovskyi Iurii
              Votes:
              5 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: