Skip to content

coverage + vararg splicing causes ClassCastException #18233

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

Closed
armanbilge opened this issue Jul 17, 2023 · 0 comments · Fixed by #18424
Closed

coverage + vararg splicing causes ClassCastException #18233

armanbilge opened this issue Jul 17, 2023 · 0 comments · Fixed by #18424
Assignees
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug

Comments

@armanbilge
Copy link
Contributor

Compiler version

3.3.2-RC1-bin-20230715-4851278-NIGHTLY

Minimized code

//> using scala 3.3.2-RC1-bin-20230715-4851278-NIGHTLY
//> using option -coverage-out:scoverage-data

enum Foo:
  case Bar, Baz

object Foo:
  def render = List(values.tail*).mkString

@main def main = println(Foo.render)

Output

Exception in thread "main" java.lang.ClassCastException: class [LFoo; cannot be cast to class scala.collection.immutable.Seq ([LFoo; and scala.collection.immutable.Seq are in unnamed module of loader 'app')
        at Foo$.render(test.scala:8)
        at test$package$.main(test.scala:10)
        at main.main(test.scala:10)

Expectation

If I disable coverage I get:

Baz
@armanbilge armanbilge added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 17, 2023
@jchyb jchyb added area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html area:enums and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 18, 2023
@KacperFKorban KacperFKorban self-assigned this Aug 17, 2023
KacperFKorban referenced this issue in dotty-staging/dotty Aug 18, 2023
KacperFKorban referenced this issue in dotty-staging/dotty Aug 19, 2023
KacperFKorban referenced this issue in dotty-staging/dotty Aug 28, 2023
KacperFKorban referenced this issue in dotty-staging/dotty Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants