Java Is Unsound: The Industry Perspective
This seems to be a set of examples that don&#x27;t work, rather than a set of examples that prove a point. For example:<p><pre><code>    interface IFoo&lt;T&gt;  { Number foo(T t);  }

    class Foo&lt;T extends Number&gt; implements IFoo&lt;T&gt; {
        public Number foo(T t) { return t; }
    }

    Number bar(IFoo&lt;String&gt; foos) { return foos.foo(&quot;Nan&quot;); }
</code></pre>
This implies that something bad is going on. But the class in the middle is a red herring. It is not used in this example, nor can it be used as an argument to the `bar` method. Try instantiating a Foo&lt;String&gt; and it wont work. Try instantiating a Foo&lt;Integer&gt; and then passing that to bar(), which requires an IFoo&lt;String&gt;. Both are <i>compile</i> time errors.<p>By all means claim, correctly, that support of unchecked code and raw types means that the type system is not &quot;sound&quot;, but the incorrect examples undermine the claim that this is a problem. (I don&#x27;t personally think that its a problem, and the fact that someone claiming otherwise can only provide examples that fail to prove that its a problem isn&#x27;t terribly convincing. But then I grew up with 6502 ASM, which had a fairly limited type system).