Skip to content

bug: Command.Builder<C>.senderType must narrow the sender type down #793

Description

@DanikVitek

As can be seen from this line:

public fun <C : Any> Command.Builder<C>.senderType(type: KClass<out C>): Command.Builder<C> =

The type is not being narrowed, even though the Java version of the method for both Class and TypeToken overloads does narrow it down. This could be fixed in the following way:

public fun <C : Any, N : C> Command.Builder<C>.senderType(type: KClass<out N>): Command.Builder<N> =
    senderType(type.java)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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