|
|
|
|
|
by ygra
3007 days ago
|
|
If the final keyword hadn't existed before I'd agree, but it does exist, does exactly what you'd expect it to here, and I'd argue that since it's consistent with how it used to work, is actually easier to understand and grasp. Local type inference is a new feature. Locals that can be assigned once is not and people are already familiar with how such locals are declared. And there's no ambiguity which variant is the correct one, e.g.: var i = 0;
final var i = 0;
int i = 0;
final int i = 0;
val i = 0;
One of the options there is a very odd one. And if there was "val", would "final var" be disallowed? |
|