-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix compilation error if Repeated is included in Diagrams assertion #2037
fix compilation error if Repeated is included in Diagrams assertion #2037
Conversation
Hi @taisukeoe, we require contributors to sign our Contributor License Agreement, and we don't have yours on file. In order for us to review and merge your code, please access https://www.artima.com/cla/choose-type to sign our Contributor License Agreement. Your effort is highly appreciated. Thank you. |
@cla-bot[bot] check |
The cla-bot has been summoned, and re-checked this pull request! |
@taisukeoe Sorry for getting back late to this and thanks for the fix! The fix looks good and worked great for Scala 3, but the added test for vararg seems working only under Scala 3, when built with Scala 2:
From the error message may be we can enhance our Scala 2 macro to support it, if not perhaps the test can be added under dotty/diagrams-test instead? |
@cheeseng
As long as I quickly checked, this error is occurred only when Oops, this change seems to break Scala 3 side test. I'm checking this.
|
It is fixed now. Would you please review this again? @cheeseng |
@taisukeoe Thanks for the latest version! The changes works great! One last thing you may want to add the tests into DiagrammedAssertionsSpec.scala also, which is a sibling tests for DiagrammedAssertions that calls the assert function through mixed in trait, instead of directly through Diagrams companion object. @bvenners I have tested this with Scala 2.10, 2.13, 3.0, js and native. |
@cheeseng |
I'd like to report a bug with the latest combination, Scala 3.0.0, ScalaTest 3.2.9 and sbt 1.5.2, and fix the bug by this PR.
About the bug:
Test/compile
fails in Diagramsassert
which takes an expression including varargs in Scala 3.0.0. It compiles in Scala 2.13.6.Minimal Reproducible project
https://github.com/taisukeoe/scala3-scalatest/tree/aba74a99d00cd42b1215147f62d094a2ce628488
About This PR
This PR fixes the above compilation error, and make Diagrams assertion works with varargs, which is represented by
Typed(Repeated(_, _), _)
term.Note
There is still a Diagrams assertion error message corruption in Scala 3.0.0, as follows.