File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package rx
2
2
3
3
import rx .opmacros .Factories
4
4
5
+ import scala .annotation .unchecked .uncheckedVariance
5
6
import scala .collection .mutable
6
7
import scala .util .Try
7
8
@@ -146,10 +147,9 @@ object Rx {
146
147
* automatically when the [[owner ]] recalculates, in order to avoid
147
148
* memory leaks from un-used [[Rx ]]s hanging around.
148
149
*/
149
- class Dynamic [T ](func : (Ctx .Owner , Ctx .Data ) => T , owner : Option [Ctx .Owner ])(implicit name : sourcecode.Name ) extends Rx [T ] { self =>
150
- // TODO: Be Covariant over T, (currently IsomorphicVar writes into cache, therefore Invariant)
150
+ class Dynamic [+ T ](func : (Ctx .Owner , Ctx .Data ) => T , owner : Option [Ctx .Owner ])(implicit name : sourcecode.Name ) extends Rx [T ] { self =>
151
151
152
- private [rx] var cached : Try [T ] = _
152
+ private [rx] var cached : Try [T @ uncheckedVariance ] = _
153
153
154
154
private [rx] var depth = 0
155
155
private [rx] var dead = false
Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ object BasicTests extends TestSuite{
145
145
a() = 0
146
146
intercept[Exception ]{
147
147
b.now
148
+ ()
148
149
}
149
150
assertMatch(b.toTry){case Failure (_) => }
150
151
}
You can’t perform that action at this time.
0 commit comments