I have a custom exception e.g. ```expect open clas...
# multiplatform
I have a custom exception e.g.
Copy code
expect open class FirebaseException(message: String) : Exception
And in Android actual code:
Copy code
import com.google.firebase.FirebaseException

actual typealias FirebaseException = FirebaseException
In the
code, I have a sub-class of this
Copy code
class DocNotFoundException : FirebaseException(
    "Fetched document is not present in the collection"
I have a
class for backend communication and here it looks like:
Copy code
sealed class Result<out R> {
    data class Success<out T>(val data: T) : Result<T>()
    data class Error(val ex: Exception) : Result<Nothing>()
In my
of Android module, when I use the above exception like this:
Copy code
if (result is Result.Error && result.ex is DocNotFoundException) {
    // Do something
I get an error saying:
Copy code
Incompatible types: DocNotFoundException and kotlin.Exception /* = java.lang.Exception */
NOTE: This is only in IDE (AS), when I compile the code, it works fine.