tek / splain

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

first draft for diverging implicit splanation. Recommended to integrate ASAP to engage test users #70

Closed tribbloid closed 2 years ago

tribbloid commented 2 years ago

voila

github-actions[bot] commented 2 years ago

Test Report (2.13.6)

  8 files  +1    8 suites  +1   8s :stopwatch: -1s 46 tests +5  41 :heavy_check_mark: +5  5 :zzz: ±0  0 :x: ±0 

Results for commit 037a1ea5. ± Comparison against base commit ed45b804.

:recycle: This comment has been updated with latest results.

tek commented 2 years ago

amazing! can we have a toggle option for this?

tribbloid commented 2 years ago

@tek errr. I don't know how to do this. Is it possible to add new settings called Vimplicit-diverging under global.settings? Or we have to write our own parser?

tek commented 2 years ago

did we have a pressing reason for entirely removing configuration via -P:splain parameters?

tribbloid commented 2 years ago

@tek no, but all of them (as in 0.5.x) are already ignored by the compiler (thus the document for 1.x gave them new names).

I wonder if we can still use the -Vxxx format, or it is not how compiler plugin works

tek commented 2 years ago

I'm unclear about that, give it a try! otherwise, I don't see why we shouldn't have both -V and -P options

tribbloid commented 2 years ago

I don't have experience writing compiler plugin, do you know any compiler insider in lightbend?

It seems very unlikely, -Vxxx compiler options are verified to ensure no typo, obviously not by our code.

tek commented 2 years ago

I think we should just go ahead and use -P:splain for any extra options.

tribbloid commented 2 years ago

@tek good idea, resubmitted, which enabled the following 2 parameters:

    val implicitDiverging = "Vimplicits-diverging"

    val implicitDivergingMaxDepth = "Vimplicits-diverging-max-depth"

enabled by "-P:splain:Vxxxx"

tribbloid commented 2 years ago

The max-depth was added in fear of breaking the implicit search algorithm

tribbloid commented 2 years ago

Could you review and approve it again? Looks good on CI

tek commented 2 years ago

ship it!