Compiler class warning at compile time

Given the following minimum code:

package object MyPackage { case class Pimp(private val i: Int) extends AnyVal } 

SBT (0.13.8) complains:

 [warn] sbt-api: Unhandled type class scala.reflect.internal.Types$MethodType : ($this: myPackage.package.Pimp)Int 

My build file is something like this:

 Project("sbtissue", file("sbtissue")).settings(scalaVersion := "2.11.6") 

Change the corresponding line in the source file to:

 class Pimp(private val i: Int) extends AnyVal 

or

 case class Pimp(i: Int) extends AnyVal 

does not cause compilation warning. What can I do to prevent this warning?

Related: https://groups.google.com/forum/#!topic/simple-build-tool/KWdg4HfYqMk

+5
source share
1 answer

I think you found a legit crane if there could be a small niche.

I would recommend abandoning private , because it is not very similar to the idea of ​​the case class, and also, given the existence of the generated unapply, it does not hide this value anyways:

 Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40). Type in expressions to have them evaluated. Type :help for more information. scala> case class Pimp(private val i: Int) extends AnyVal defined class Pimp scala> val p1 = Pimp(1) p1: Pimp = Pimp(1) scala> p1.i <console>:11: error: value i is not a member of Pimp p1.i ^ scala> val Pimp(n) = p1 n: Int = 1 
+3
source

All Articles