You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2019/05/20 07:04:00 UTC

[jira] [Updated] (GROOVY-8498) [PARROT] Support `var` keyword of Java10

     [ https://issues.apache.org/jira/browse/GROOVY-8498?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King updated GROOVY-8498:
------------------------------
    Summary: [PARROT] Support `var` keyword of Java10  (was: Support `var` keyword of Java10)

> [PARROT] Support `var` keyword of Java10
> ----------------------------------------
>
>                 Key: GROOVY-8498
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8498
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 3.0.0-alpha-2, 2.6.0-alpha-4
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)