This subtle example minimized from ScalaTest code base requires two files and a particular compilation order: _1.scala:_ ``` scala final class PosZInt private (val value: Int) extends AnyVal object PosZInt { def from(value: Int): Option[PosZInt] = if (value >= 0) Some(new PosZInt(value)) else None } ``` _2.scala:_ ``` scala object Test { scala.util.Try(PosZInt.from(1).get) } ``` `run 2.scala 1.scala` Leads to: ``` assertion failed: private constructor PosZInt in class PosZInt in 1.scala accessed from method $anonfun in object Test in 2.scala ``` I'm guessing the generated code is correct, so maybe it should be enough to remove / relax the assertion?