Groovy
  1. Groovy
  2. GROOVY-5167

GDK date methods not recognized by the static type checker

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-1
    • Fix Version/s: 2.0-beta-2
    • Component/s: Static Type Checker
    • Labels:
      None

      Description

      I was playing with the following snippet:

      import groovy.transform.TypeChecked
      @TypeChecked void m() {
          def s = "1234"
          println s.toInteger()
          s = 1234
          println s * 3
          s = new Date()
          println s.year
          println s.format("yyyyMMdd")
      }
      m()
      

      And the static type checker was complaining on the s.format() call.
      The format() method is part of DateGroovyMethods, not directly DefaultGroovyMethods, for modularity sake, and hence it wasn't recognized.

        Activity

        Guillaume Delcroix created issue -
        Cédric Champeau made changes -
        Field Original Value New Value
        Fix Version/s 2.0-beta-2 [ 18072 ]
        Affects Version/s 2.0-beta-1 [ 17925 ]
        Cédric Champeau made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12734091 ] Default workflow, editable Closed status [ 12745894 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12971614 ] Default workflow, editable Closed status [ 12979420 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        32m 50s 1 Cédric Champeau 05/Dec/11 10:09
        Resolved Resolved Closed Closed
        18d 16h 58m 1 Paul King 24/Dec/11 03:08

          People

          • Assignee:
            Cédric Champeau
            Reporter:
            Guillaume Delcroix
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development