Related commit: dd8f041
?. invocation in context of a statement-expression should be allowed even if result type of the invocation cannot be made nullable.
I'm expecting it also to work with void methods in expression-bodied form, as well as void lambda expressions:
using System;
class C<T> {
void F1(C<T> c) {
c?.M(); // compiles fine
// error CS0023: Operator '?' cannot be applied to operand of type 'T'
Action a = () => c?.M();
}
// error CS0023: Operator '?' cannot be applied to operand of type 'T'
void F2(C<T> c) => c?.M();
T M() => default(T);
}