Uploaded image for project: 'SonarJava'
  1. SonarJava
  2. SONARJAVA-1580

Parametrized methods: Type inference not fully resolved with combined Parametrized Type

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.13
    • Component/s: Semantic
    • Labels:
      None

      Description

      In the following code, the call to the parametrized methods is not correctly resolved, as the substitution of T is not found.

      class C {
        <T> Child<A<T>> foo(Parent<? extends B<T>> b) { return null; }
      
        void tst(Parent<B<String>> b) {
          // call to method 'foo' not recognized
          Child<A<String>> result = foo(b);
        }
      }
      
      interface A<X> { }
      interface B<Y> { }
      interface Parent<Z> { }
      interface Child<E> extends Parent<E> { }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                michael.gumowski Michael Gumowski
                Reporter:
                michael.gumowski Michael Gumowski
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: