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

STC: false positive for Class method called from static context

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment