This is a follow-up question to my previous question
I have been reading this post and it comes up with the following example showing how Java type system is unsound:
interface IFoo<T> {
Number foo(T t);
}
class Foo<T extends Number> implements IFoo<T> {
public Number foo(T t) { return t; }
}
Number bar(IFoo<String> foos) { return foos.foo("NaN"); }
And in the same post it talks about how we can never instantiate such Foo<String>. But does it really prove type system being unsound?
Also, based on the answer to the previous question, to prove type "Preservation" not happening, we need to prove type system being unsound. But this example can never be "evaluted" and then we check if after evaluation type is preserved because there is no such a Foo<String>. I am very confused.