[英]Scala - Nested type keyword
I was going through Akka source code, and I came across the following 我正在查看Akka源代码,并且遇到了以下内容
type Repr[+O] <: FlowOps[O, Mat] {
type Repr[+OO] = FlowOps.this.Repr[OO]
type Closed = FlowOps.this.Closed
}
type Closed
Can someone explain me what's going on here ?? 有人可以解释一下这是怎么回事吗?
FlowOps[O, Mat] {
type Repr[+OO] = FlowOps.this.Repr[OO]
type Closed = FlowOps.this.Closed
}
is a compound type with a refinement . 是具有改进的复合类型 。 Namely,
FlowOps[O, Mat]
by itself can have any Repr
and Closed
type members; 即,
FlowOps[O, Mat]
本身可以具有任何Repr
和Closed
类型成员;例如, here we require specific ones. 在这里,我们需要特定的。 This type is used as an upper bound for the type member
type Repr[+O]
. 此类型用作类型成员
type Repr[+O]
的上限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.