protected override void VisitReturnSyntax(ReturnSyntax pNode) { Store.SetValue("ReturnFound", pNode.Values.Count > 0); var count = Store.GetValue <int>("ReturnValueCount"); //If we have 0 return values it will be caught when we return to the method for checking return statements if (count > 0 && pNode.Values.Count != count) { CompilerErrors.MethodReturnCount(count, pNode.Span); } //Return statements can't be deferred otherwise we would defer forever! if (pNode.Deferred) { CompilerErrors.InvalidDefer(pNode.Span); } base.VisitReturnSyntax(pNode); }