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

Static type checking not working for fields assigment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-3
    • 2.0-rc-1
    • Static Type Checker
    • None

    Description

      The following classes should fail to compile:

       
      @TypeChecked
      class StaticGroovy1 {
        Date foo = ""
      }
      
      @TypeChecked
      class StaticGroovy2 {
          Closure<List> cls = { Date aDate ->  aDate.getTime() }
      }
      
      @TypeChecked
      class StaticGroovy3 {
          
          static Closure<Long> cls = { Date aDate ->  aDate.getTime() }
          
          def bar() {
              cls("")
          }
      }
      

      See discussion associated to this bug

      Attachments

        Activity

          People

            melix Cédric Champeau
            rgarcia Renato Garcia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: