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

Static type checking failure for streams and spread operator

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment