The same argument applies to this as to the 'the type of final fields from their assigned value' case. So, possible perhaps within @CompileStatic contexts.
On Wed, Aug 23, 2017 at 8:52 AM, MG <[email protected]> wrote: > Hi Paul, > > On 21.08.2017 04:30, Paul King wrote: > > > Introduce a "var" (o.s.) keyword that allows deduction of type through >> assignment: >> var device = new PrinterDevice(...) // device variable will have type >> PrinterDevice without the need to explictely state that >> Rationale: This is a well known feature of other languages, that reduces >> the need to explictely define the type of variables. >> > > How is this different to the current type inferencing? > > > The variable/field will have the type of the initally assigned value > (instead of Object when using def), therefore one cannot accidentially > assign any other type to it. > > Cheers, > Markus > > >
