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.
I have a class that looks like this:
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 theAnyVal
subclassing) fixes this issue.