List<? super Number> myNumsContra = new ArrayList<Number>();
myNumsContra.add(2.0F);
myNumsContra.add(2);
myNumsContra.add(2L);
System.out.println(myNumsContra.get(0)); //should throw error
According to the contravariance rule for generics the get(0) call above should throw a compile error. But I don't see this happening. Is there something I missed ? I am using Java-8