Skip to content

Formatting issue for annotated type parameter #3040

Description

@jacekgajek

Given

  internal object IntSerializer : KSerializer<Int> {
    override val descriptor: SerialDescriptor
      get() = PrimitiveSerialDescriptor(IntSerializer::class.qualifiedName!!, PrimitiveKind.STRING)

    override fun serialize(encoder: Encoder, value: Int) {
      encoder.encodeString(value.toHexString())
    }

    override fun deserialize(decoder: Decoder): Int = 0
  }

The following expression

  internal data class Foo(val bar: List<Pair<@Serializable(IntSerializer::class) Int, String>>)

after running ./gradlew spotlessApply, it is reformatted to

  internal data class Foo(
    val bar: List<
      Pair<
        @Serializable(IntSerializer::class)
        Int,
        String,
        >,
      >,
  )

even though line max len is not exceeded, no matter how I split this.

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