问题标签 [context-bound]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
scala - 在 scala 中绑定的类型之后的另一个子类型
class PEControl[T <: Data : Arithmetic](accType: T)
,这是来自 riscv-gemmini 的类定义。Data
type 是 chisel 中的基本数据类型,提供对, 和Arithmetic
的一些算术运算。Data
abstract class Arithmetic[T <: Data]
使用的语法是<: Type : Type
什么,这是什么意思?我发现语法是TypeParamBounds ::= TypeBounds {‘:’ Type}
从这里调用的。哪里可以详细了解一下,谢谢。
scala - 上下文绑定在特征上
我想做类似的事情
或者
换句话说,我希望 traitA
能够“扩展” Copyable
,或者只能与Copyable
类型混合。
注意:理想情况下,foo
应该有类型this.static_type
(当前不存在),它代表this
.