Secondary constructor in Kotlin
I have 2 secondary constructors for a data class.
data class node(var type: String):parentNode(){
constructor(type: String, value: aNode) : this(type)
constructor(type: String, value: bNode) : this(type)
}
I want to return a value from a function which is node(type:String, value:aNode).
fun getNode(): node{
val aNode = getAnode
val type = "Bank"
val return_val = node(type,aNode)
return (return_val)}
a = getNode()
Now 'a' has only the 'type' but not 'aNode'.
Any idea on what am i...