Is there any way to give compiler a hint about nullability in case of chained methods?

48 Views Asked by At

Consider type Foo and something which yields IEnumerable<Foo?>.

Later in code I do seq.Where(x => x != null), so effectively it should become IEnumerable<Foo> for all other methods down the chain.

Is there an elegant way to let compiler know items are not null anymore?

0

There are 0 best solutions below