ToString does not seem to work for me

Dani Mező <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAKxP=D4P5mZFSqh1VdCqRKfr1xCiu7OFiaSqs=UxoeGy2F=3ig@mail.gmail.com>
Hi fellow devs,

I ran into a problem, where ToString() does not work for me, I'd like to
post here before I open a bug ticket, I am sure I did something wrong.
My classes below.

Main.groovy:

class Main {
    static void main(args) {
        println(new Card(name: "hey"))
    }
}

Card.groovy:

import groovy.transform.ToString;

@ToString
class Card {
    String name;
}

My output:

Card@43f02ef2

I expected the class to be pretty printed into my console, but that is not
the case.
What do I do wrong?

I am building with
Intellij 2020.3.2
Groovy 3.0.7
OpenJDK 15.0.2

Any suggestions?

Cheers, Daniel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.