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

Compilation error in @CompileStatic

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.0-alpha-1, 2.4.12
    • Fix Version/s: 2.4.13
    • Component/s: Static compilation
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: