Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6302954

Inference fails for type variable return constraint

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic, x86
    • OS:
      generic, windows_2000, windows_xp
    • Verification:
      Verified

      Backports

        Description

        https://bugs.eclipse.org/bugs/show_bug.cgi?id=98379

        This program doesn't compile:

        public class X {
            <T extends X> T f1() throws Exception{
             return null;
            }
            <U extends X> U f2() throws Exception {
                return f1();
            }
        }

        X.java:6: type parameters of <T>T cannot be determined; no unique maximal instance exists for type variable T with upper bounds U,X
                return f1();
                         ^
        1 error

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  ahe Peter Ahe
                  Reporter:
                  ahe Peter Ahe
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: