-
Notifications
You must be signed in to change notification settings - Fork 782
Closed
Description
Hello! I would expect the following code to be valid.
var source = Observable.Empty<BaseClass>();
var destination = source
.Where(x => x is DerivedClass)
.Cast<DerivedClass>();
However, Cast takes an IObservable<object>, and therefore the types are not compatible. Calling the method directly doesn't work either...
var source = Observable.Empty<BaseClass>();
var filtered = source
.Where(x => x is DerivedClass);
var destination = Observable.Cast<DerivedClass>(filtered);
In both cases, the following compilation error is produced.
Argument 1: cannot convert from 'System.IObservable<T>' to 'System.IObservable<object>'
Is there a reason to avoid doing something like this?
Metadata
Metadata
Assignees
Labels
No labels