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

Cannot use @CompileStatic and @Sortable together

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0, 2.3.3
    • 2.3.4, 2.4.0-beta-2
    • None
    • None
    • JDK8

    Description

      Without @CompileStatic this compiles,

      import groovy.transform.*
      import java.time.LocalDateTime
      
      //@CompileStatic
      @TupleConstructor
      @EqualsAndHashCode
      @ToString
      @Sortable(includes = ['completed'])
      class DeliveryBucket {
          LocalDate completed
          Long count
      }
      

      With @CompileStatic enabled, it fails with 'Access to java.lang.Object#completed is forbidden'

      Attachments

        Activity

          People

            paulk Paul King
            ysb33r Schalk W. Cronjé
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: