Skip to content

Kotlin compiler error: inherited platform declaration clashes #1690

@jmfayard

Description

@jmfayard

Describe the bug

As a Kotlin programmer, I would like to create an Exception that extends both GraphQLError and RuntimeException

data class KotlinGraphqlException(val msg: String, val e: Throwable? = null) : 
    RuntimeException(msg, e), 
    GraphQLError 
{
    override fun getErrorType() = ErrorType.ValidationError
}

This is possible in Java, but not in Kotlin because both GraphQLError and RuntimeException have an inherited message property

image

Work-around: we currently have to define this class in Java. It's the only Java class in our project :/

Request: add a base class for Kotlin users that extends both GraphQLError and RuntimeException

I could hack my way by extending graphql.schema.CoercingParseLiteralException that does it, but it's not semantically correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions