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

GDK date methods not recognized by the static type checker

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-1
    • 2.0-beta-2
    • Static Type Checker
    • 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.

      Attachments

        Activity

          People

            melix Cédric Champeau
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: