tek / splain

better implicit errors for scala
MIT License
370 stars 28 forks source link

Indented formats for Refined types and Tuple types #111

Closed tribbloid closed 12 months ago

tribbloid commented 1 year ago

Considering the following 3 examples:

object Long {
  class VeryLong[T]

  implicitly[VeryLong[
    VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[String]]]]]]]
  ]]
}

object Long {
  class VeryLong[T]

  implicitly[VeryLong[
    VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[String]]]]]]]
  ] { type A = Int; type B = Int; type C = Int; type D = Int; type E = Int; type F = Int; type G = Int; type H = Int}]
}

object Long {
  class VeryLong[T]

  implicitly[
      (
          VeryLong[Int],
          VeryLong[
            VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[VeryLong[Int]]]]]]]
          ]
      )
  ]
}

They all look similar, but the last 2 will print everything in 1 row. The decision to choose flat format for Refined types and Tuple types have corrupted the very long higher kind application inside, making it hard to read

This can be addressed by implementing the missing indented long formats