4 ms·
It has nothing to do with the expression’s simplicity. There are rules uphold by the compiler, and those are displayed in the easiest example possible. There ma
by kaba0 2y ago
It has nothing to do with the expression’s simplicity. There are rules uphold by the compiler, and those are displayed in the easiest example possible. There may be additional rules that could show a warning in these cases (e.g. java can track whether a variable gets initialized in both branches and similar quite well), but that’s besides the point. Take these examples in a way that the only thing you know about variable `a` is its type.
- mmaniac 2y agoThese are stupid rules. The point of the proposal is to invite discussion on the proposed rules. Introducing implicit type conversions that throw to a language which is otherwise strongly typed is an awful idea. Java should take a look at its own history and how it was able to retrofit generics into the language. It's nearly all type safe and the unfortunate unsafe parts generate compiler warnings.
- kaba0 2y agoHow is it not type or null safe? It’s as safe as it can be.