I want to use multple Constructors like this :
data class MyData<T>(
val code: String,
val message: String,
val data: T? = null,
) {
constructor(code: String, message: String) : this(code, message, null)
}
and I Use
MyData(code = "-1", message = "Support only application/json Content-Type") // Error : Not Enough Information To Infer Parameter T
MyData(code = "-1", message = "message", data = "data")
How to Use MyData property 'data' default value is 'null'? ( I want to MyData(code, message) not MyData(code, message) )