Are you sure it's not because getName() returns String? and not String (not nullable)?
There seems to be an inconsistency between how you defined pushNode (second arg is Any) and what you are seeing the list (second arg is Any?)
Most of the "incorrect type" errors I have encountered writing Kotlin code were coming from the incompatibility between `Type?` and `Type`. It takes a little while to get used to but it's worth the trouble.
I am starting to get a "sense" of what you are saying - Type v Type? Thank you.
What I do not yet understand is what is jet.String? Again, newbie here… Is jet.String a class? If it is, what is the relationship to java.lang.String. If I’m stumbling on this then others coming to Kotlin may also - so maybe a discussion should be added to the documentation about this.
Thank you to everyone who is helping me on my Kotlin journey.