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

Can't compile method with generic signatures and default visibiliy access

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.10
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser-antlr
    • Labels:
      None

      Description

      The following script results in a compilation error

      class Foo {
          <T extends Object> void foo(T t) {}
      }
      
      f = new Foo()
      // compiler output
      1 compilation error:
      
      unexpected token: < at line: 2, column: 5
      

      Adding a visibility accessor makes it work

      class Foo {
          public <T extends Object> void foo(T t) {}
      }
      
      f = new Foo()
      

        Issue Links

          Activity

          Hide
          paulk Paul King added a comment -

          Is this the same as GROOVY-4901?

          Show
          paulk Paul King added a comment - Is this the same as GROOVY-4901 ?
          Hide
          daniel_sun Daniel Sun added a comment -

          Fixed in the parrot branch

          Show
          daniel_sun Daniel Sun added a comment - Fixed in the parrot branch

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              aalmiray Andres Almiray
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development