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

STC: false positive for Class method called from static context

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.19
    • 3.0.20
    • None
    • None

    Description

      Consider the following:

      @TypeChecked
      class C {
        static String typeName = this.getName() // instance method from Class
      }
      

      This emits error "Non-static method Class#getName cannot be called from a static context".

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: