Java 10 introduced local type inference, which is really cool:
var list = new ArrayList<String>(); // Compiles fine
However, it appears people are reluctant to update their Java versions the day (week, month, year) a new release is out.
This means that I need to wait till the EOL of Java 8 before I can even use List.of(1, 2, 3)
if want to support the majority of users using old Java versions.
Local type inference on the other hand, would likely be inferred when it is compiled to bytecode, so presumably programs using it would likely run on older Java versions (9 or 8). On the other hand, Java seems to like doing optimizations at runtime, which could mean that type-inference requires JRE version 10.
Has anyone tried this out? Do programs using type inference run on older Java versions?
Your input is appreciated.