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

STC: error for map*.value assignment

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      @groovy.transform.TypeChecked
      void test() {
        Map<String,Object> map = [foo:'bar']
        map*.value = 'baz' // Incompatible generic argument types. Cannot assign java.util.List<java.lang.String> to: java.util.List<java.lang.Object>
      }
      

      I believe this assignment should work since the RHS string is indeed an Object. Not sure if the LHS type should be List<? extends Object> or the RHS type should be List<? super String>.

      Attachments

        Activity

          People

            emilles Eric Milles
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: