Strongly related to #263
Reproduced on R3 1.3.0 (.NET 10)
The case that bit me (no shade, I love this library):
var rp = new ReactiveProperty<int>(1);
var view = rp.ToReadOnlyReactiveProperty(); // instance method returns self
view.Dispose();
rp.Value = 5; // throws ObjectDisposedException
More generally, code that looks the same requires different disposal handling:
var rp = new ReactiveProperty<int>(1);
ReadOnlyReactiveProperty<int> asReadOnly = rp; // cast, same object
Observable<int> asObservable = rp; // cast, same object
ReferenceEquals(rp, rp.ToReadOnlyReactiveProperty()); // True - instance method
ReferenceEquals(rp, asReadOnly.ToReadOnlyReactiveProperty()); // True - instance method
ReferenceEquals(rp, asObservable.ToReadOnlyReactiveProperty()); // False - extension method
Passing an argument also flips which method is called:
ReferenceEquals(rp, rp.ToReadOnlyReactiveProperty()); // True - instance method (no params)
ReferenceEquals(rp, rp.ToReadOnlyReactiveProperty(99)); // False - extension method (one param)
Strongly related to #263
Reproduced on R3 1.3.0 (.NET 10)
The case that bit me (no shade, I love this library):
More generally, code that looks the same requires different disposal handling:
Passing an argument also flips which method is called: