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

TypeChecked : Cannot use diamond <> with anonymous inner classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2
    • 2.3.1
    • None
    • Maven 3 with groovy-eclipse-compiler 2.8.0-01
      OpenJDK 1.7.0_51

    Description

      @TypeChecked
      class Issue1 {
      
          public void issue(){
      
              Function<String,String> function = new Function<String,String>() {
                  @Override
                  String apply(String input) {
                      return "ok"
                  }
              }
          }
      }
      

      Compiler fails with the following error:
      TypeChecker/src/main/java/org/issues/Issue1.groovy: 14 Groovy:[Static type checking] - Cannot use diamond <> with anonymous inner classes

      See attachment (org.issues.Issue1)

      Attachments

        1. TypeChecker.zip
          3 kB
          Nicolas Labrot

        Activity

          People

            melix Cédric Champeau
            nithril Nicolas Labrot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: