다음 코드를 이해하려고합니다. 그러나 나는 R # X가 무엇을 의미하는지 모른다. 누군가 나를 도울 수 있니?스칼라에서 A # B의 의미는 무엇입니까
// 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 's X"(특정 R 's X와 대조적으로, 예를 들어 r1.X)를 의미합니다. 더 깊이 파고 싶다면 "유형 투영법"이라고합니다. 귀하의 정보에 대해 – AmigoNico
감사합니다. – user1484819