Program: 130397
Project: 130397
Buggy source:
@RequiredReadAction @NotNull @Override public List<CompilerCheckBuilder> check(@NotNull CSharpLanguageVersion languageVersion,@NotNull CSharpHighlightContext highlightContext,@NotNull CSharpBlockStatementImpl element){
  PsiElement parent=element.getParent();
  if (!(parent instanceof DotNetModifierListOwner)) {
    return Collections.emptyList();
  }
  final List<CompilerCheckBuilder> results=new ArrayList<CompilerCheckBuilder>();
  final Set<String> names=new THashSet<String>();
  parent.accept(new CSharpRecursiveElementVisitor(){
    @Override @RequiredReadAction public void visitLocalVariable(    CSharpLocalVariable variable){
      String name=variable.getName();
      if (names.contains(name)) {
        results.add(newBuilder(variable.getNameIdentifier(),name));
      }
 else {
        names.add(name);
      }
      DotNetExpression initializer=variable.getInitializer();
      if (initializer != null) {
        initializer.accept(this);
      }
    }
    @Override public void visitCatchStatement(    CSharpCatchStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitIfStatement(    CSharpIfStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitTryStatement(    CSharpTryStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitBlockStatement(    CSharpBlockStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitForeachStatement(    CSharpForeachStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitForStatement(    CSharpForStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitParameter(    DotNetParameter parameter){
      String name=parameter.getName();
      names.add(name);
    }
    @Override public void visitLambdaExpression(    CSharpLambdaExpressionImpl expression){
      visitAndRollback(expression);
    }
    @Override public void visitAnonymMethodExpression(    CSharpDelegateExpressionImpl method){
      visitAndRollback(method);
    }
    @Override public void visitLambdaParameter(    CSharpLambdaParameterImpl parameter){
      String name=parameter.getName();
      if (names.contains(name)) {
        results.add(newBuilderImpl(CS0136.class,parameter.getNameIdentifier(),name,name));
      }
 else {
        names.add(name);
      }
    }
    private void visitAndRollback(    PsiElement e){
      Set<String> oldSet=new HashSet<String>(names);
      visitElement(e);
      names.clear();
      names.addAll(oldSet);
    }
  }
);
  return results;
}

Fixed version (ground truth):
@RequiredReadAction @NotNull @Override public List<CompilerCheckBuilder> check(@NotNull CSharpLanguageVersion languageVersion,@NotNull CSharpHighlightContext highlightContext,@NotNull CSharpBlockStatementImpl element){
  PsiElement parent=element.getParent();
  if (!(parent instanceof DotNetModifierListOwner)) {
    return Collections.emptyList();
  }
  final List<CompilerCheckBuilder> results=new ArrayList<CompilerCheckBuilder>();
  final Set<String> names=new THashSet<String>();
  parent.accept(new CSharpRecursiveElementVisitor(){
    @Override @RequiredReadAction public void visitLocalVariable(    CSharpLocalVariable variable){
      String name=variable.getName();
      if (names.contains(name)) {
        results.add(newBuilder(variable.getNameIdentifier(),name));
      }
 else {
        names.add(name);
      }
      DotNetExpression initializer=variable.getInitializer();
      if (initializer != null) {
        initializer.accept(this);
      }
    }
    @Override public void visitCatchStatement(    CSharpCatchStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitIfStatement(    CSharpIfStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitTryStatement(    CSharpTryStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitBlockStatement(    CSharpBlockStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitForeachStatement(    CSharpForeachStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitFixedStatement(    CSharpFixedStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitForStatement(    CSharpForStatementImpl statement){
      visitAndRollback(statement);
    }
    @Override public void visitParameter(    DotNetParameter parameter){
      String name=parameter.getName();
      names.add(name);
    }
    @Override public void visitLambdaExpression(    CSharpLambdaExpressionImpl expression){
      visitAndRollback(expression);
    }
    @Override public void visitAnonymMethodExpression(    CSharpDelegateExpressionImpl method){
      visitAndRollback(method);
    }
    @Override public void visitLambdaParameter(    CSharpLambdaParameterImpl parameter){
      String name=parameter.getName();
      if (names.contains(name)) {
        results.add(newBuilderImpl(CS0136.class,parameter.getNameIdentifier(),name,name));
      }
 else {
        names.add(name);
      }
    }
    private void visitAndRollback(    PsiElement e){
      Set<String> oldSet=new HashSet<String>(names);
      visitElement(e);
      names.clear();
      names.addAll(oldSet);
    }
  }
);
  return results;
}