groovy
  1. groovy
  2. GROOVY-5178

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

    Details

    • Type: Bug Bug
    • Status: Closed 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
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      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 {
          
      }
      

        Activity

        CÚdric Champeau made changes -
        Field Original Value New Value
        Assignee Cedric Champeau [ melix ]
        Fix Version/s 2.0-beta-2 [ 18072 ]
        Affects Version/s 2.0-beta-1 [ 17925 ]
        Component/s Static Type Checker [ 15261 ]
        Component/s SQL processing [ 12873 ]
        CÚdric Champeau made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Valery Shyshkin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: