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

Static import of a property messes with instance method

    Details

      Description

      bugs.groovy
      import static A.bar
      
      class A {
        static bar = "A"
      }
      
      def bar() {
        "bar"
      }
      
      @groovy.transform.CompileStatic
      def usage() {
        bar()
      }
      
      println usage() 
      
      13: [Static type checking] - Cannot find matching method A#bar(). Please check if the declared type is right and if the method exists.
       @ line 13, column 3.
           bar()
           ^
      

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              daniilo Daniil Ovchinnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: