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

Regression in 2.5.16: Class<?>[] cannot be assigned to Class<?>...

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.16
    • 2.5.17
    • Static Type Checker
    • None

    Description

      Consider this example, where Validator comes from javax.validation:validation-api:1.1.0.Final:

      package test
      
      import javax.validation.Validator
      
      import groovy.transform.CompileStatic
      
      @CompileStatic
      class TestValidator {
      	
      	Validator validator
      	
      	 void foo(Object bean, List<Class<?>> groups) {
      		 validator.validate(validator, groups as Class<?>[])
      	 }
      }
      

      The compilation of this class fails in 2.5.16 (but succeeds in 2.5.15-) with the following error:

      /home/mauro/workspace/TestGroovyGradle2/src/main/groovy/test/TestValidator.groovy: 13: [Static type checking] - Cannot call <T> javax.validation.Validator#validate(T, java.lang.Class <java.lang.Object extends java.lang.Object>[]) with arguments [javax.validation.Validator, java.lang.Class <?>[]] 
       @ line 13, column 4.
                       validator.validate(validator, groups as Class<?>[])
            ^
      
      1 error
      

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              mauromol Mauro Molinari
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: