Hey everyone, While running code coverage I see al...
# code-coverage
s
Hey everyone, While running code coverage I see all lines of a Kotlin sealed
object
are covered except the first line, the definition of the class: so
object MyObject : Person()
is not covered, while all the inner children are covered. Any idea how I can resolve this?
k
What do you mean by "sealed object"?
s
Scratch that
Object Person {
Data class Me(…)
}
I hVe test for Me But Person is not covered
k
The
data class Me
is just enclosed in
object Person
but it's not actually part of the object. It's not an inner class, but just a nested class. Thus, when you test
<http://Person.Me|Person.Me>
you're simply using
Person
as a namespace. To actually test
Person
, you need to check a property of the object.
s
Yeah The Person object is more of a place where we aggregate component related to that. They can leave outside of Person but I think having that makes it easier to access the content from other class by typing Person. Bla bla
k
There is a new feature request being considered, to introduce namespaces to Kotlin. That might be the answer you're looking for.
c
The feature request in question: https://github.com/Kotlin/KEEP/issues/348
s
yeah! that is what I need!