Skip to content

Primitive unboxed inconsistently with coverage enabled #22834

@hearnadam

Description

@hearnadam

Compiler version

  • 3.3.4
  • 3.6.4

Minimized code

//> using option "-coverage-out:coverage"
object Unbox extends App {
    val m = new java.util.HashMap[String, Double]()
    def method: Option[Double] = Option(m.get(""))
    println(method)
}

Output

With coverage:

Some(0.0)

Without coverage:

None

Expectation

Unboxing of null Boxed primitives should not depend on coverage being enabled/disabled. I would expect None to be printed in both contexts.

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