Hi again, I have question related to generic types...
# getting-started
o
Hi again, I have question related to generic types, I have fallowing piece of code:
Copy code
private fun saveSetState() {

        val cardSaveList: MutableList<CardMeta<*>> = mutableListOf()

        cardSaveList.plus(wrapWithMeta(DumbCard()))

        val json = gson.toJson(cardSaveList)
        print(json)
    }

    private fun <T> wrapWithMeta(card: T): CardMeta<T> where T : Card {
        return CardMeta<T>(card.javaClass.canonicalName, card)
    }
This is work in progress, but idea is to have list of CardMeta serialize it to Json for future read