Skip to content

Rename Nothing type to avoid confusion with Kotlin's #1335

@alexander-yevsyukov

Description

@alexander-yevsyukov

Kotlin has standard type which is named Nothing. It is used in function declarations when it never returns because of throwing an exception.

We have a specialized Message type, io.spine.server.model.Nothing, which serves as a return type of handler methods that do not return anything. These methods do return an instance of such message and exit normally.

This may bring various confusions for Kotlin people:

  • Why do we have a handler method that never completes? Just by looking at the method signature, it's not possible to tell that it's Spine-specific Nothing, not the standard Kotlin's one.
  • What doesn't this handler work? I don't know what declaring wrong Nothing in a Kotlin code for a handler would cause, but I'm not sure it would be OK.
  • Fully-qualified Spine's Nothing when the user's code needs to use Kotlin's one.
  • etc.

In order to avoid this confusion we need to have a type with another name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions