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

poor error message when using @Delegate with similar method signatures but having different return types

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Won't Fix
    • 2.2.0-beta-1
    • None
    • xforms
    • None

    Description

      For this class:

      class MapSet {
        @Delegate Set d1 = [5]
        @Delegate Map d2 = [a: 1]
      }
      println new MapSet()
      

      We get this error:

      Cannot override method java.lang.Object remove(java.lang.Object) in java.util.Map with new method having a primitive return type and old method not
      . At [-1:-1]  at line: -1, column: -1
      

      Some kind of error is to be expected since with have conflicting primitive "boolean" and "Object" return types but Groovy should attempt to detect this earlier in the @Delegate annotation and give a more meaningful error message.

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: