我在这个博客中看到了这段代码:Type-Level Programming in Scala
// define the abstract types and bounds
trait Recurse {
type Next <: Recurse
// this is the recursive function definition
type X[R <: Recurse] <: Int
}
// implementation
trait RecurseA extends Recurse {
type Next = RecurseA
// this is the implementation
type X[R <: Recurse] = R#X[R#Next]
}
object Recurse {
// infinite loop
type C = RecurseA#X[RecurseA]
}
在代码R#X[R#Next]
中有一个我从未见过的运算符#
。由于它很难搜索(被搜索引擎忽略),谁能告诉我它是什么意思?
https://stackoverflow.com/questions/9443004
复制相似问题