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

STC: type argument not applied to error message

    XMLWordPrintableJSON

Details

    Description

      Consider the following:

      class C<T> {
        void setP(T t) { }
      }
      class D<X> extends C<X> {
      }
      @groovy.transform.TypeChecked
      void test() {
        new D<Number>().p = 'x' // Cannot assign value of type java.lang.String to variable of type T
      }
      

      Error message references "T" and not "java.lang.Number".

      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: