scala泛型函数`not found:type?`

时间:2016-06-20 05:07:11

标签: scala generics kind-projector

当我使用scala创建这样的函数时,它告诉我not found: type ?

scala
    def save[
      K: SpatialComponent: TypeTag,
      V <: CellGrid: TypeTag: ? => TileMergeMethods[V]: ? => TilePrototypeMethods[V]
      ](id: LayerId, rdd: RDD[(K, V)] with Metadata[TileLayerMetadata[K]], method: KeyIndexMethod[K])

有人可以告诉我如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

我知道了,必须将此代码添加到build.sbt。

resolvers += Resolver.sonatypeRepo("releases")
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.8.0" cross CrossVersion.binary)

https://github.com/non/kind-projector