You could try the newest version (2020.3), but if that does not help, I
would guess JetBrains might possibly not even be aware that Groovy 3.x
supports that feature. In that case creating a ticket is imho your best
option (there are people from Jetbrains reading this ML, but they need a
ticket to work on the issue*) - I would recommend posting the ticket URL
here, so people can upvote - I sure will G-)
Cheers,
mg
*I would also recommend closely following the ticket guidelines, i.e.
describe current (erronous) state, and the expected behavior - in short
you want to make it easy for them to work on this.
On 11/12/2020 15:40, Saravanan Palanichamy wrote:
Hi MG
I am using Intellij IntelliJ IDEA 2020.2.3 (Community Edition)
Build #IC-202.7660.26, built on October 6, 2020
I have attached the error as a picture. The intellij web page says 3.0
is supported. I am not sure what to make of it though. The code runs
cleanly and as expected
https://www.jetbrains.com/help/idea/groovy.html
<https://www.jetbrains.com/help/idea/groovy.html>
regards
Saravanan
On Fri, Dec 11, 2020 at 2:59 PM MG <mg...@arscreat.com
<mailto:mg...@arscreat.com>> wrote:
Hi Saravanan,
what IntelliJ version are you using ? We are not using multiple
assignments in our code, but from my personal experience, IntelliJ
can
unfortunately sometimes be more than 2 years behind current Groovy
features. If the newest IntelliJ version does not support what you
need,
opening a ticket did help in the past (see e.g.
https://youtrack.jetbrains.com/issue/IDEA-193168
<https://youtrack.jetbrains.com/issue/IDEA-193168>), but you have
to be
prepared to wait some time before seeing improvements.
In addition to that, IntelliJ sometimes marks valid Groovy code as
invalid, but reconsiders if one comments out the "offending" line(s),
and then comments it in again (I assume doing this triggers a new
Intellisense parser pass).
Interestingly afaik (disclaimer: I have not checked this recently,
and
we are still on Groovy 2.5.x), Groovy will treat e.g.
var x = new Foo()
and
final x = new Foo()
as x having type Object - it is just IntelliJ Intellisense that
deduces
x to be of type Foo*, thereby enabling auto completion, etc on x ;-)
Cheers,
mg
*In all but the most obscure cases
On 11/12/2020 06:54, Saravanan Palanichamy wrote:
> Hello
>
> I am using Groovy 3.0.5 and it supports multiple assignment
statements from tuples when using static compile
>
> def(var1, var2) = Tuple.tuple("a", 1)
>
> but it looks like the Intellij IDE still calls this out as a
compile error. Also it defaults to identifying var1 and var2 as
objects. This hinders code completion in subsequent code. Is this
an issue for anyone else? or do I just have to upgrade my IDE?