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

generics: problem with type inference for recursive methods

    XMLWordPrintable

Details

    • tiger
    • generic
    • solaris_8

    Description

      class Bug2
      {
      static <T> boolean isOK(T x)
      {
      return isOK(x);
      }

      static <T> boolean isStillOK(T x)
      {
      return true && isOK(x);
      }

      static <T> boolean isNoMoreOK(T x)
      {
      return true && isNoMoreOK(x);
      // incompatible.types
      // found: <T>boolean
      // required: java.lang.Object
      }

      static <T> boolean isOKAgain(T x)
      {
      boolean res;
      return true && (res = isOKAgain(x));
      }
      }


      Attachments

        Activity

          People

            gafter Neal Gafter
            gafter Neal Gafter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: