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

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

    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

          People

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

            Dates

              Created:
              Updated:
              Resolved: