- var mg = res as MethodGroupExpr;
- if (mg != null) {
- var emg = res as ExtensionMethodGroupExpr;
- if (emg != null && !emg.ResolveNameOf (rc, ma)) {
- return true;
- }
-
- if (!mg.HasAccessibleCandidate (rc)) {
- ErrorIsInaccesible (rc, ma.GetSignatureForError (), loc);
- }
-
- if (ma.HasTypeArguments) {
- Error_MethodGroupWithTypeArguments (rc, ma.Location);
- }
+ //
+ // LAMESPEC: Why is conditional access not allowed?
+ //
+ if (!IsLeftResolvedExpressionValid (ma.LeftExpression) || ma.HasConditionalAccess ()) {
+ rc.Report.Error (8082, lexpr.Location, "An argument to nameof operator cannot include sub-expression");
+ return false;