The compiler does warn when you discard a value, but I assume a C# notebook is something like Jupyter? It is probably a special case in that environment.
There is Comparer.Create convenience method which creates an IComparer instance from a lambda. But yeah it is a workaround.