bugfix> scala > 投稿

私は scalaVersion := "2.10.5" を使用していますおよび libraryDependencies += "org.rogach" %% "scallop" % "3.1.2".

Getting following error: Exception in thread "main" java.lang.NoSuchMethodError: scala.collection.immutable.$colon$colon.hd$1()Ljava/lang/Object; at org.rogach.scallop.DefaultConverters$$anon$2.parse(DefaultConverters.scala:27) at org.rogach.scallop.ValueConverter$class.parseCached(ValueConverter.scala:21) at org.rogach.scallop.DefaultConverters$$anon$2.parseCached(DefaultConverters.scala:24) at org.rogach.scallop.Scallop$$anonfun$verify$17.apply(Scallop.scala:632) at org.rogach.scallop.Scallop$$anonfun$verify$17.apply(Scallop.scala:630) at scala.collection.immutable.List.foreach(List.scala:381) at org.rogach.scallop.Scallop.verify(Scallop.scala:630) at org.rogach.scallop.ScallopConfBase.verifyBuilder(ScallopConfBase.scala:405) at org.rogach.scallop.ScallopConfBase.verify(ScallopConfBase.scala:744) at com.unity3d.ads.conf.OperativeEventConverterConf.(OperativeEventConverterConf.scala:50) at com.unity3d.ads.analytics.TestClass$.main(TestClass.scala:51) at com.unity3d.ads.analytics.TestClass.main(TestClass.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:738) at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:187) at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:212) at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:126) at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

まったく同じコードが scalaVersion := "2.11.8" で正常に機能しています

残念ながら、sparkバージョン1.6を使用しているため、2.10.5を使用する必要があります。

サンプルコード:

`import org.rogach.scallop.{ScallopConf, ScallopOption, Serialization, ValueConverter, singleArgConverter}
class TestClass(args: Seq[String]) extends ScallopConf(args) with Serialization {
val testInput: ScallopOption[String] =
opt[String](
name = "test.input",
descr = "test",
required = false,
default = Option("testPath"))
verify()
}
`

scala 2.10.5で動作させるためにここで使用できる回避策はありますか?