Groovy Method pointer operator

Answered

Hello,
I use IntelliJ IDEA 2020.3.2 (Ultimate Edition) Build #IU-203.7148.57, built on January 26, 2021


When I write a groovy script lisk following:

class Creature {
String type

String getType() {
return "From getter, ${type}"
}

String getTypeWithArg(String arg) {
return "${type}&${arg}"
}
}

def cat = new Creature(type: 'cat')
def aMethod = Creature.&getTypeWithArg
println(aMethod (cat,"arges"))


I got a hit:

but I can run it as expected and get the answer : cat&arges.

Am i missing some configuration for groovy or it is something wrong in IDEA this version there?

0
1 comment

Here is the link to bug request where this issue will be investigated further: https://youtrack.jetbrains.com/issue/IDEA-260855

0

Please sign in to leave a comment.