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

STC: error for abstract class private or package-private field access

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      package p
      abstract class A {
        private priv
        @PackageScope pack
      }
      
      @TypeChecked
      void test(p.A a) {
        a.@priv // MissingFieldException
        a.@pack // MissingFieldException
        a.priv  // MissingPropertyException
        a.pack  // MissingPropertyException
      }
      

      Access to "priv" and "pack" outside of A will always fail, since a subclass instance is required.

      Attachments

        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