I was looking at the Wiki entry on Java and noticed in the generics section that the type system was
shown to be unsound in 2016. The article on this has the following code:

Java Code:
public class Unsound {
   static class Constrain<A, B extends A> {
   }
   static class Bind<A> {
      <B extends A> A upcast(Constrain<A, B> constrain, B b) {
         return b;
      }
   }
 
   static <T, U> U coerce(T t) {
      Constrain<U, ? super T> constrain = null;
      Bind<U> bind = new Bind<>();
      return bind.upcast(constrain, t);
   }
   public static void main(String[] args) {
      String zero = Unsound.<Integer, String> coerce(0);
   }
 
}
Indeed, when I compile and run with JDK 1.8.0_121 on Windows 10 I get the class cast exception. However, Eclipse Neon.2
catches and flags the error. Just thought it might be interesting to some. It may be more appropriate in the
forum lobby section so feel free to move it. Note: I have not read the article.

Regards,
Jim