Details

    • Type: Sub-task
    • Status: Closed
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 8
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • CPU:
      unknown
    • OS:
      generic

      Description

      The following code compiles even if it shouldn't:

      1)

      class Foo<X> {
       X x;
      }

      class Test {
         void m(int i) { }

         void test(Foo<? extends Integer> fi) {
            m(fi.x);
         }
      }

      2)

      class Test<T extends Integer> {
        void i(int arg) {}
        void foo(T arg) { i(arg); }
      }

      3)

      class CaptureTest {
        <T> List<T> singleton(T arg) { return null; }
        
        void test(List<? extends Number> l) {
          List<Number> ln = singleton(l.get(0));
        }

      }

        Attachments

          Activity

            People

            • Assignee:
              mcimadamore Maurizio Cimadamore
              Reporter:
              mcimadamore Maurizio Cimadamore
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: