Skip to content

Conversation

@idg10
Copy link
Collaborator

@idg10 idg10 commented Oct 22, 2025

Resolves #2247

This enables e.g.

IObservable<string?> s = ...;
IObservable<string> s.OfType<string>()

to filter it down to just the non-null strings.

This is consistent with how System.Linq.Async was changed (and how the .NET runtime library replacement for this, System.Linq.AsyncEnumerable` also works).

This enables e.g.

```cs
IObservable<string?> s = ...;
IObservable<string> s.OfType<string>()
```

to filter it down to just the non-null strings.

This is consistent with how System.Linq.Async was changed (and how the .NET runtime library replacement for this, System.Linq.AsyncEnumerable` also works).
@idg10 idg10 merged commit 0aa0a00 into main Oct 22, 2025
7 checks passed
@idg10 idg10 deleted the feature/2247-oftype-nullable-elements branch October 22, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align IObservable.OfType operator nullability with IEnumerable and IAsyncEnumerable.

3 participants