Rule for semantics of ?: in the presence of generics and generic class Class

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 5.0
    • Affects Version/s: 1.4.2, 5.0
    • Component/s: tools
    • b28
    • generic, x86
    • solaris_8, windows_xp

      Existing code such as

      Class a = boolean ? A.class : B.class;

      should compile without error, in spite of the fact that (with generics
      enabled) neither A.class nor B.class is a subtype of the other. With
      wildcards, the result type should be

      Class<?>

      Or, if A is a base class of B,

      Class<? extends A>

      This is a backward compatibility issue.

            Assignee:
            Neal Gafter (Inactive)
            Reporter:
            Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: