How to extend a class that has multiple constructors in Kotlin?

Update: Since M11 (0.11.*), you can use secondary constructors to solve this problem:

class PhotoLibException : RuntimeException {
    constructor(message: String, ex: Exception?): super(message, ex) {}
    constructor(message: String): super(message) {}
    constructor(ex: Exception): super(ex) {}
}

Currently, there’s no way to call different super-constructors in different context from the same class. It will be supported in the upcoming months, though.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)