【发布时间】:2017-09-17 14:53:12
【问题描述】:
我希望我的函数接收实现 2 个特征的类型。
是否可以创建这样的“临时”特征类型?
例如:
trait t1 {
... //stuff....
}
trait t2 {
... // more stuff....
}
class MyClass {
def functionMix(input : t1&&t2 type) {
.... the input implements t1 and t2 trait
}
}
【问题讨论】: