groovy

Newline in interfaces declaration with generics is not fully supported.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.5, 1.7-beta-2
  • Fix Version/s: 1.6.6, 1.7-rc-1
  • Component/s: Compiler
  • Labels:
    None
  • Testcase included:
    yes
  • Number of attachments :
    0

Description

A newline after '>' fails the compiler in interface declaration (the following does not compile):

public interface MyGenericInterface<T extends Object>
{
}
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
MyGenericInterface.groovy: 1: unexpected token: <newline> @ line 1, column 54.
   ricInterface<T extends Object>
                                 ^

1 error

But if the newline is not preceded by a '>', compiler is happy (the following compile):

public interface MyGenericInterface<T extends Object> extends java.util.List
{
}

or

public interface MyGenericInterface<T extends Object> {
}

This does not repro in classes (the following compiles):

public class MyGenericClass<T extends Object>
{
}

Activity

Hide
Roshan Dawrani added a comment -

Fixed.

Show
Roshan Dawrani added a comment - Fixed.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: