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

interface constants from super interfaces lost in some contexts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.5.14, 3.0.7, 4.0.0-alpha-2
    • None
    • None

    Description

      This script:

      class Baz {
          static void main(args) {
              println new Inner().inner()
          }
          static class Inner implements Bar {
              def inner() {
                  FOO
              }
          }
      }
      
      interface Foo {
          int FOO = 1
      }
      
      interface Bar extends Foo {
          int BAR = 3
      }
      

      Fails with:

      Apparent variable 'FOO' was found in a static scope but doesn't refer to a local variable, static field or class...
      

      Looks like an unintended side effect of fixing GROOVY-9598:

      https://github.com/apache/groovy/commit/fc5de1cf3ce6

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m