-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Code coverage crashes at runtime #15078
Comments
Can you take a look @TheElectronWill ? |
I'll take a look. Thanks for reporting! |
This issue has a really high concentration of Guillaumes 😅 |
Will power! |
Guillaume³ taking over the world. |
It seems that the types generated by the lifter are not treated correctly by the following phases, in the case of varargs with type arguments. extension (v: Int) def save(): java.io.File =
{
scala.runtime.coverage.Invoker.invoked(2, "target/o")
{
{
scala.runtime.coverage.Invoker.invoked(1, "target/o")
{
val $1$: String = "porc-epic"
val $2$: java.nio.file.attribute.FileAttribute[?]* =
([ : java.nio.file.attribute.FileAttribute[?]]*)
{
scala.runtime.coverage.Invoker.invoked(0, "target/o")
java.nio.file.Files.createTempDirectory($1$, $2$)
}
}.toFile()
}
}
}
*** error while checking target/bug.scala after phase refchecks ***
exception occurred while compiling target/bug.scala
java.lang.AssertionError: assertion failed: Found: ($2$ : java.nio.file.attribute.FileAttribute[?]*)
Required: Array[? <: java.nio.file.attribute.FileAttribute[?]]
found: ??
expected: ?? Note that the parser produces java.nio.file.Files.createTempDirectory("porc-epic",
[ : java.nio.file.attribute.FileAttribute[?]]*
) which works OK. But using such a type for a variable doesn't seem to be supported. Is it expected? |
I was testing the new coverage support for scala3 with:
The latest version of
sbt-scoverage
https://github.com/scoverage/sbt-scoverage/tree/V2
with https://github.com/scoverage/sbt-scoverage/blob/V2/src/main/scala/scoverage/ScoverageSbtPlugin.scala#L162 set to 3.2.0-RC1-bin-SNAPSHOT
This call crashes with the instrumented code:
https://github.com/MasseGuillaume/porc-epic/blob/main/src/test/scala/porcEpic/unit/VisualizationTest.scala#L53
https://github.com/MasseGuillaume/porc-epic/blob/07157829817afd03d286f056f3c0dda3fd5e6eca/src/main/scala/porcEpic/Visualization.scala#L59-L80
Compiler version
latest (main branch)
Minimized code
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: