相关疑难解决方法(0)

"结构细化中的参数类型可能不会引用在该细化之外定义的抽象类型"

当我编译:

object Test extends App {
  implicit def pimp[V](xs: Seq[V]) = new {
    def dummy(x: V) = x
  }
}                                                                                                                                                                                                              
Run Code Online (Sandbox Code Playgroud)

我明白了:

$ fsc -d aoeu go.scala
go.scala:3: error: Parameter type in structural refinement may not refer to an abstract type defined outside that refinement
    def dummy(x: V) = x
        ^
one error found
Run Code Online (Sandbox Code Playgroud)

为什么?

(Scala:"结构细化中的参数类型可能不会引用在该细化之外定义的抽象类型"并不真正回答这个问题.)

scala

26
推荐指数
2
解决办法
3386
查看次数

标签 统计

scala ×1