2 ms·
So... you can assign null to a variable whose type is illegal to instantiate (but not to define), and code which has that variable in scope which will compile w
by scythe 10y ago
So... you can assign null to a variable whose type is illegal to instantiate (but not to define), and code which has that variable in scope which will compile with the assumption that the type can be instantiated.
>Is it safe for Foo<String> to be a valid type?
Wrong question. Is it useful for Foo<String> to be a valid type? The answer is probably no. So why allow it? The below example does not come close to explaining why this should be a language feature.