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

Type checker doesn't flag static method calls to instance methods with otherwise the same signature

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.8
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      Example code which fails at runtime but should fail at compile time:

      class Foo {
        def bar() {}
      }
      
      @groovy.transform.TypeChecked // MME at runtime, the same as dynamic groovy
      //@groovy.transform.CompileStatic // would give GroovyCastException at runtime
      def method() {
        Foo.bar()
      }
      
      method()
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                paulk Paul King
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: