tek / splain

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

`noImplicitFoundError` API in AnalyzerPlugin doesn't have annotation message #67

Closed tribbloid closed 2 years ago

tribbloid commented 2 years ago

When I try to enable 2 tests that uses implicit error messages. I found the following design flaw in the AnalyzerPlugin interface:

    override def noImplicitFoundError(param: Symbol, errors: List[ImplicitError], previous: String): String = {

      val convertedErrors = errors.map(convertError)

      val result = splainAnalyzer.formatImplicitError(
        param.asInstanceOf[splainAnalyzer.global.Symbol],
        convertedErrors,
        ""
      )

      result
    }
  }

As can be seen, the annotation argument in formatImplicitError is hardcoded to empty, causing all such messages to be ignored

This is because noImplicitFoundError doesn't provide it, furthermore it cannot be found anywhere. This is an example of a degrading quality of source code caused by premature integration of API

tribbloid commented 2 years ago

add a quite inefficient patch that seems to do the work. Integrate?

tek commented 2 years ago

yup!

tribbloid commented 2 years ago

Closing for integrated.

Just realised that this was my first time using the merge button, hope you don't mind. I promise to only do this after the review

tek commented 2 years ago

:grin: no worries