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

Type checker should treat gstrings as strings for generic collections

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1
    • Static Type Checker
    • None

    Description

      Following code:

      @groovy.transform.TypeChecked
      def test() {
          def bar = 1
          List<String> list = ["foo", "$bar" ]
      }
      

      Produces

      [Static type checking] - Incompatible generic argument types. Cannot assign java.util.List <java.io.Serializable> to: java.util.List <String>
       at line: 5, column: 5
      

      Attachments

        Issue Links

          Activity

            People

              melix Cédric Champeau
              graemerocher Graeme Rocher
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: