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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.4.8
    • Static Type Checker
    • 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

            No work has yet been logged on this issue.

            People

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

              Dates

                Created:
                Updated:
                Resolved: