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

Compilation error in @CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.0-alpha-1, 2.4.12
    • 2.4.13
    • Static compilation
    • None

    Description

      This should be compiled and executed normally

      import groovy.transform.CompileStatic
      
      class Bar {
        void vararg(boolean flag = true, Class<?>... classes) {}
      }
      
      @CompileStatic            
      class Foo extends Bar{
        def test() {
          vararg(false, Foo)
        }
      }
      
      new Foo().test()
      

      But the result of compilation is
      [Static type checking] - Cannot call Foo#vararg(java.lang.Class <java.lang.Object>[]) with arguments [boolean, java.lang.Class <Foo>]

      Attachments

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              Alexey Afanasiev Alexey Afanasiev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: