protected override void Visit(CodeLambda method) { // when lambda-method used inside of other method - it inherits owner method context // otherwise it create own naming context // when we inherit context - we create context copy to avoid parent context pollution var parentContext = _parametersAndVariables; _parametersAndVariables = CreateNewNamesSet(parentContext); base.Visit(method); // restore context _parametersAndVariables = parentContext; }
protected override void Visit(CodeLambda method) { VisitList(method.CustomAttributes); if (!method.CanOmmitTypes) { VisitList(method.Parameters); } if (method.Body != null) { VisitList(method.Body); } }