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

STC: closure array or varargs parameter not properly type-checked

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      def m(Closure<Number>... closures) {
        closures*.call().sum()
      }
      @groovy.transform.TypeChecked
      void test() {
        print m({->1},{->'2'})
      }
      

      No error is given for the improper String return type.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: