我想在类中添加一个方法Observable
。到目前为止我所做的是:
object Extension {
implicit class ObservableExtensions(obs: Observable[Double]) extends Observable{
def fakeMethod (alpha: Double): Observable[Double] = {
obs
.map(v => v+alpha)
}
}
}
但我得到:
Error: trait Observable takes type parameters
implicit class ObservableExtensions(obs: Observable[Double]) extends Observable{
^
怎么了?