Ahhhhh, nevermind, my Card.groovy was a Card.java, and ToString just had no
effect I guess.

Dani Mező <dani.su...@gmail.com> ezt írta (időpont: 2023. jan. 19., Cs,
14:01):

> 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
>

Reply via email to