Hi everyone. Is it possible to infer generic type ...
# getting-started
s
Hi everyone. Is it possible to infer generic type from alternative object construtor? (see example below)
Copy code
data class IdentifiableBox<out T>(val id: String, val t: T) {
    constructor(myObject: MyObject): this(myObject.id, myObject)
}
in that case I get type mismatch on this(myObject.id, myObject) But it's pretty obvious that I expect IdentifiableBox<MyObject> to be constructed