News for hackers. Stuff that matters.
Re:JEP 286: Local-Variable Type Inference by gabriele on Thursday March 10, 2016 @03:32PM (#11262053)
I expect this breaking a few things in fields injection (a la Spring @Autowired[1]) if implemented.

[1] https://docs.spring.io/spring-framework/docs/current/spring-...

Re:JEP 286: Local-Variable Type Inference by ygra on Thursday March 10, 2016 @04:15PM (#11262394)
How would type inference for local variables mess with fields?
Re:JEP 286: Local-Variable Type Inference by gabriele on Friday March 11, 2016 @03:19AM (#11265396)
according to Spring's documentation[1]:

@Autowired is fundamentally about type-driven injection

If you replace:

    @Autowired
    FooDao fooDao;
with something like:

    @Autowired
    var fooDao;
I'm pretty sure type-driven injection breaks.

[1] https://docs.spring.io/spring/docs/current/spring-framework-...

Re:JEP 286: Local-Variable Type Inference by radq on Friday March 11, 2016 @06:19AM (#11265935)
The proposal only applies to local variables with non-null initializers. I'm pretty sure you can't autowire local variables with Spring, and they don't have initializers anyway.
Re:JEP 286: Local-Variable Type Inference by ubertaco on Friday March 11, 2016 @06:06AM (#11265899)
Yeah, but that's a case where "var" is probably the wrong choice anyways, because of the non-obvious "human type resolution" -- i.e. if I'm a human reading this code, I can't obviously tell the type FooDao, where in simple cases like var path = Paths.get("/foo/bar/bonk") I can.
Re:JEP 286: Local-Variable Type Inference by TheCoelacanth on Friday March 11, 2016 @09:34AM (#11266804)
var isn't a dynamic type. var is a compiler-inferred static type. `var fooDao;` will refuse to compile because the compiler can't infer the type. `var fooDao = new FooDao()` will still have the type FooDao for fooDao, it is just inferred by the compiler instead of being explicitly declared by the programmer.