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

@Override should be allowed (and verified) on properties that implement an interface

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Compiler
    • None

    Description

      I would like @Override to be allowed (and verified) on fields that implement an interface.

      For instance, this is valid Groovy code:

      interface Parent {
          String getSetting()
      }
      class Child implements Parent {
          final String setting ='my setting'
      }
      

      I'd like to add the @Override to the field and have the compiler verify that it does override the getter in the parent. It should work on boolean getters too, I suppose.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              hamletdrc Hamlet D'Arcy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: