- Notifications
You must be signed in to change notification settings - Fork 128
Closed
Description
If you add method with a default argument, and the expression for the argument's default value refers to a method or val, then it is always shown as uncovered even if you invoke it.
For example:
object DefaultArgumentsObject { val defaultName = "world" def makeGreeting(name: String = defaultName): String = { s"Hello, $name" } } class DefaultArgumentsObjectTest extends FlatSpec with OneInstancePerTest { "DefaultArgumentsObject" should "execute the default block if no arg is given" in { val result = DefaultArgumentsObject.makeGreeting() assert(result === "Hello, world") } } Then "defaultName" is always shown in red.
I have looked into this, but I haven't been able to figure out what's wrong, so I can't submit a fix at this time. I will submit a PR to the scoverage-samples project with a demo.
Metadata
Metadata
Assignees
Labels
No labels