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

STC allows assign an array to any type which is not an array

    XMLWordPrintableJSON

Details

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

    Description

      STC allows assign an array to any type which is not an array

      import groovy.transform.*
      
      @TypeChecked 
      class Foo {
          def say() {
              FooAnother foo1 = new Foo[13] // but FooAnother[] foo1 = new Foo() reports a STC                        Error
          }
      }
      class FooAnother {
          
      }
      

      Attachments

        Activity

          People

            melix Cédric Champeau
            vns Valery Shyshkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: