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

type checker does not check generics bounds of wildcards properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.2, 2.3.0, 2.4.0-rc-1
    • 2.4.6
    • Static Type Checker
    • None

    Description

      public <T extends List<CharSequence>> void bar(T a){}
      bar([new Object()])
      

      This should not compile because Object is no CharSequence, but it does, because the type checker will simply ignore the bound and set T to LinkedList<Object>

      Attachments

        Activity

          People

            pascalschumacher Pascal Schumacher
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: