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

Type checker ignores wrong number of constructor arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.7, 2.2.0-beta-2, 2.3.0, 2.4.0-rc-1
    • 2.4.6
    • Static Type Checker
    • None

    Description

      class X {}
      @groovy.transform.CompileStatic
      def foo() {
        new X("f")
      }
      println foo()
      

      This code compiles and runs in static compilation, even though the type checker should have complained. In normal Groovy this fails at runtime, as does if the type checker only is used.

      Attachments

        Activity

          People

            pascalschumacher Pascal Schumacher
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: