Skip to content

coverage + vararg splicing causes ClassCastException #18233

Closed
@armanbilge

Description

@armanbilge

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

Metadata

Metadata

Assignees

Labels

area:coverageCode coverage, see https://dotty.epfl.ch/docs/internals/coverage.htmlitype:bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions