scoverage / scalac-scoverage-plugin

Scoverage Scala Code Coverage Core Libs
https://github.com/scoverage
Apache License 2.0
423 stars 126 forks source link

My project fails to compile when using Scoverage #515

Closed markehammons closed 1 year ago

markehammons commented 1 year ago

Describe the bug

When I try to use scoverage in my project, it triggers nasty compiler crashes on test

Quick Reproduction:

  1. go to gitpod.io/#https://github.com/markehammons/slinc/tree/switch-to-scoverage
  2. run ./mill j17.test in the console
  3. watch the compiler die

Slower Reproduction

  1. Clone from https://github.com/markehammons/slinc/tree/switch-to-scoverage
  2. Download and/or switch to java 17 (sdkman is helpful here)
  3. run ./mill j17.test
  4. watch the compiler die

Expected behavior

I expected the compiler to not crash. I believe that the code scoverage generates, and my own (which is heavy on compile-time programming) interfere with each other in this regard

What build tool are you using?

Mill

Version of scoverage

v2.0.7

ckipp01 commented 1 year ago

Thanks for the report @markehammons. However, it looks like it's actually the compiler that is puking here so you'll need to report this in https://github.com/lampepfl/dotty since Dotty is actually generating the coverage here. You'll also want to probably try to minimize if possible.

ckipp01 commented 1 year ago

Actually looking further, it looks like this is actually fixed in nightly for example if you set your scalaVersion to 3.2.2-RC1-bin-20221026-a210b7f-NIGHTLY you'll see that it works. Seems that this pr fixed it https://github.com/lampepfl/dotty/pull/16235. I'll go ahead and close.