scala generic function `not found: type ?`

百般思念 提交于 2019-12-12 14:23:24

问题


When I use scala to create a function like this,It told me that 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])

Can somebody told me how to resolve this?


回答1:


I got it,must add this code to build.sbt.

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

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



来源:https://stackoverflow.com/questions/37914942/scala-generic-function-not-found-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!