#nullable enable
using System.Linq;
T Id<T>(T x) => x;
T? Id2<T>(T? x) => x;
var xs = new[] { (string?)"foo" };
var ys = xs.Select(Id); // ❌ inferred type is IEnumerable<string>
string y = ys.Single(); // ❌ no warning CS8600: Converting [...] possible null value to non-nullable type.
var zs = xs.Select(x => Id(x)); // ✔ inferred type is IEnumerable<string?>
string z = zs.Single(); // ✔ warning CS8600: Converting [...] possible null value to non-nullable type.
var ys2 = xs.Select(Id2); // ✔ inferred type is IEnumerable<string?>
string y2 = ys2.Single(); // ✔ warning CS8600: Converting [...] possible null value to non-nullable type.