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

STC: no error for incompatible type bounds on return value

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      def <T extends CharSequence> T chars() {
        "foo"
      }
      @groovy.transform.TypeChecked
      List test() {
        chars()
      }
      

      The return type extends CharSequence, which is incompatible with List. No STC error is produced. This is a follow up from GROOVY-7316.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: