Is there any way to achieve this: ``` @OptIn(Ex...
# getting-started
d
Is there any way to achieve this:
Copy code
@OptIn(ExperimentalContracts::class)
    inline fun <reified R> isA(): Boolean {
        contract {
            returns(true) implies (this@Correlated is Correlated<R>) // Error: Cannot check for instance of erased type: Correlated<R>
        }
        return data is R
    }
I want to use this in a when clause.
y
I think this is a current limitation of contracts. I think there's a youtrack issue to implement this
I found this