Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This is to provide compatibility with:
http://openjdk.java.net/jeps/286 (Java 10)
http://openjdk.java.net/jeps/323 (targeted for Java 11)
Java 10 provides var to allow reduced ceremony by avoiding manifest declaration of types for local variables for cases where type inferencing can be supported. Groovy already does this with "def" and has it's own approach for type inferencing within type-checked/compile static code. With this in mind, it seems to make most sense for Groovy to have "var" as an alias for "def" rather than closely mimic only the use cases allowed by Java.
Attachments
Issue Links
- is cloned by
-
GROOVY-8580 var keyword support: finalize behavior of keyword under static compilation
- Open
-
GROOVY-8582 CLONE - Support `var` keyword of Java10 (documentation)
- Closed