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

Interfaces and abstract classes definitions require semi-colons

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-1
    • 1.0-JSR-3
    • None
    • None

    Description

      Interfaces and abstract classes definitions require semi-colons at the end of each method signatures.
      I think the grammar could dinstinguish that we're inside an interface definition, or that the current method is an abstract methods. Thus, the body of the method is not to be expected.

      Let's see that with an example with an interface:

      interface A {
      void methodOne(String s); // here, the semi is required
      Object transform(Object o)
      }

      And with a class with an asbtract method:

      class B {
      abstract void methodTwo(String s); // here, the semi is also required
      String hello()

      { return "hello" }

      }

      If we're in an an interface, Antlr shouldn't expect method bodies. And in a class, it shouldn't expect a method body if the method is declared abstract.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: