mtkopone / scct

Scala Code Coverage Tool
http://mtkopone.github.com/scct/
Apache License 2.0
129 stars 39 forks source link

No coverage generated for AnyVal subclass constructors #52

Open nightkr opened 11 years ago

nightkr commented 11 years ago

I have a class that looks like this:

package object pimps {
    implicit class AtomicReferencePimps[T](val ar: AtomicReference[T]) {
        def transform(f: T => T) {
            var oldV: Option[T] = None
            var newV: Option[T] = None
            do {
                oldV = Some(ar.get)
                newV = Some(f(oldV.get))
            } while(!ar.compareAndSet(oldV.get, newV.get))
        }
    }
}

However, even though I use the class in one of the tests, scct still reports no coverage on the contructor ((val ar: AtomicReference[T])). Making it a regular class (removing the AnyVal subclassing) fixes this issue.