Skip to content

Different coverage results for scala 2 and scala 3 #21877

Open
@goshacodes

Description

@goshacodes

Compiler version

3.3.4

Problem

Scala 3 coverage of my project is still significantly lower than scala 2 (~ 20% for statements and 27% for branches)
I've tried to inspect reports to see differences.

  1. In general Scala 3 has much more statements and branches. Why this may be so?
  2. Scala 3 has much more classes then Scala 2. And looks like this is because of $anon class. I've tried to look closer and now macro generated code is also covered. IMO macro generated by some library code should not be covered by default, since library users are not testing libraries, but their own code.

So is it just more precise score and this is a desired behavior or not?

Scala 2.13 report

image

Scala 3 report

image

Scala 2.13 report

image image

Scala 3 report

image image

Statements

image image

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