Hi Paul,
wouldn't it make sense to combine flow typing with var x = RHS being
identical to typeof(RHS) x = RHS :
@Canonical static class Foo {
int x }
@InheritConstructors static class SonOfFooextends Foo {
int sonOfFooMethod() {2*x }
}
@Test @Ignore @CompileStatic void
The Parrot parser already has support for this at the grammar level but we
regard some of the current implementation details as experimental.
At the moment it is almost just an alias for "def" but discussions have
been around whether we can make the behavior closer to Java when used
within static
Am 21.03.2018 um 14:39 schrieb Cédric Champeau:
Thanks for the explanation, Paul, it makes sense. Long story short: do
not upgrade major libraries in bugfix releases ;)
then you will not be able to call Stream.of
bye Jochen
I see that the newly release JDK 10 now supports the "var" declaration for
local variables where the type can clearly be inferred from its initialiser:
http://openjdk.java.net/jeps/286
I note that Groovy's "def" syntax (among others) was mentioned but rejected.
Would Groovy move to support