tek / splain

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

reduction detail may display incorrect infix. #119

Closed tribbloid closed 10 months ago

tribbloid commented 10 months ago

Only affecting 1.1.0-RC0:


  import shapeless._
  import record._

    type Book = Record.`'author -> String, 'title -> String, 'id -> Int, 'price -> Double`.T

    implicitly[Book]

actual error:

implicit error;
!I e:
  ('author ->> String) ::
  ('title ->> String) ::
  ('id ->> Int) ::
  ('price ->> Double) ::
  shapeless.HNil
  ――(reduced from)
    ('author ->> String) Book
    ('title ->> String) ::
    ('id ->> Int) ::
    ('price ->> Double) ::
    shapeless.HNil

should be:

implicit error;
!I e:
  ('author ->> String) ::
  ('title ->> String) ::
  ('id ->> Int) ::
  ('price ->> Double) ::
  shapeless.HNil
  ――(reduced from)
    Book
tribbloid commented 10 months ago

here is a shorter example:

    object Test {
      trait ::[A, B]

      type K = String :: Int :: Boolean
      implicitly[K]

      def v: K = "abc"
    }
tribbloid commented 10 months ago

the above is now a test case, closing