Groovy
  1. Groovy
  2. GROOVY-4767

Compilation error for generic interface method

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.5, 1.8-beta-2
    • Fix Version/s: 1.8.1, 1.7.11
    • Component/s: Compiler
    • Labels:
      None

      Description

      Repro:

      Compile

      interface Foo {
          public <N extends Number> void foo()
      }
      

      Result:

      unexpected token: public @ line 2, column 5.
             public <N extends Number> void foo()
             ^
      

      Making Foo an abstract class avoids the problem:

      abstract class Foo {
          public abstract <N extends Number> void foo()
      }
      

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          87d 9h 14m 1 Paul King 02/Jul/11 01:59
          Resolved Resolved Closed Closed
          19d 18h 6m 1 Paul King 21/Jul/11 20:06
          Mark Thomas made changes -
          Workflow jira [ 12971144 ] Default workflow, editable Closed status [ 12978877 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12733695 ] Default workflow, editable Closed status [ 12745426 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Paul King made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.8.1 [ 17223 ]
          Resolution Fixed [ 1 ]
          Assignee Paul King [ paulk ]
          Fix Version/s 1.7.11 [ 17244 ]
          Hide
          Paul King added a comment -

          I have put in a fix and done some initial testing. Any further testing you can do would be great. Now that this is fixed, it reveals some additional checks we need to do in the compiler regarding generics that haven't been completed before now. I am expecting those checks to be done as part of fixing GROOVY-4908.

          Show
          Paul King added a comment - I have put in a fix and done some initial testing. Any further testing you can do would be great. Now that this is fixed, it reveals some additional checks we need to do in the compiler regarding generics that haven't been completed before now. I am expecting those checks to be done as part of fixing GROOVY-4908 .
          Paul King made changes -
          Field Original Value New Value
          Link This issue is depended upon by GROOVY-4908 [ GROOVY-4908 ]
          sukhyun.cho created issue -

            People

            • Assignee:
              Paul King
              Reporter:
              sukhyun.cho
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development