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: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.10
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser-antlr2
    • 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()
      

        Attachments

          Issue Links

            Activity

              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: