You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Thodoris Sotiropoulos (Jira)" <ji...@apache.org> on 2021/11/03 16:00:00 UTC

[jira] [Created] (GROOVY-10343) STC fails to infer dependent type variable

Thodoris Sotiropoulos created GROOVY-10343:
----------------------------------------------

             Summary: STC fails to infer dependent type variable
                 Key: GROOVY-10343
                 URL: https://issues.apache.org/jira/browse/GROOVY-10343
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
            Reporter: Thodoris Sotiropoulos


I have the following program

{code:java}
class A<T1, T2 extends T1> {
  T1 f;

  A(T1 f) {
    this.f = f;
  }
  T2 foo() { return null; }
}

class Test {
  void test() {
    Integer x = 1;
    var y = new A<>(x).foo();
    Integer z = y;
  }
  
}
{code}

h3. Actual behavior

{code}

{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)