In my personal opinion we should fade out the older solutions that do not support final class fields, have no type safety, etc, so I would not push Jetbrains to put effort into supporting this. If one wants instance creation without new in Groovy, I expect he typically will put @Newify(pattern = /[A-Z].*/) into his Groovy configscript, to have it active in every class, so it would not matter that the older, more restricted version works without any annotation.

Cheers,
mg


On 09/03/2020 01:36, Paul King wrote:
The named argument shorthand, which doesn't require @Newify, displays errors too (currently won't work with your Foo example since it relies on a no-arg constructor and setters):
image.png
Cheers, Paul.

On Mon, Mar 9, 2020 at 10:00 AM MG <mg...@arscreat.com <mailto:mg...@arscreat.com>> wrote:

    Hi Groovy users,

    the current IntelliJ IDEA (2019.3.3, built on February 11th 2020)
    still
    does not support all Groovy features introduced with Groovy 2.5.4
    in mid
    2018 (http://groovy-lang.org/releasenotes/groovy-2.5.html). I have
    created an umbrella issue for this back then
    (https://youtrack.jetbrains.com/issue/IDEA-193168), but it seems to
    never have been fleshed out / worked on.

    To help remedy this, I am planning to create indiviudal issues,
    starting
    with support for creating class instances without requiring the
    use of
    the new keyword:
    https://youtrack.jetbrains.com/issue/IDEA-234806.

    Groovy is all about being as concise and elegant as possible, so
    it did
    away with the needless Java semicolon at the end of lines, supports
    string interpolation and multiline strings, etc. Creating class
    instances / calling constructors without a new keyword is
    something that
    has existed in Python and Kotlin forever, so it is high time IntelliJ
    IDEA supported this Groovy feature.

    Please vote for these issues as I report them G-)
    Cheers,
    mg





Reply via email to