groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8580) CLONE - Support `var` keyword of Java10 (finalise behavior of keyword under @CompileStatic)
Date Mon, 14 May 2018 10:10:00 GMT

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

Paul King updated GROOVY-8580:
------------------------------
    Description: 
As part of GROOVY-8498 there is now support for the `var` keyword to provide compatibility
with:
http://openjdk.java.net/jeps/286 (Java 10)
http://openjdk.java.net/jeps/323 (targeted for Java 11)

For dynamic Groovy, `var` is an alias 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.

  was:
As part of GROOVY- 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.


> CLONE - Support `var` keyword of Java10 (finalise behavior of keyword under @CompileStatic)
> -------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-8580
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8580
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Daniel Sun
>            Priority: Major
>             Fix For: 3.x
>
>
> As part of GROOVY-8498 there is now support for the `var` keyword to provide compatibility
with:
> http://openjdk.java.net/jeps/286 (Java 10)
> http://openjdk.java.net/jeps/323 (targeted for Java 11)
> For dynamic Groovy, `var` is an alias 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)

Mime
View raw message