Project

General

Profile

root / branches / compiler / cSharp / ooasCompiler / src / libs / c5 / UserGuideExamples / BugHashedArray.cs @ 3

1
/*
2
 Copyright (c) 2003-2006 Niels Kokholm and Peter Sestoft
3
*/
4

    
5
// C5 bugs 2007-09-16
6

    
7
// Compile with 
8
//   csc /r:C5.dll BugHashArray.cs 
9

    
10
using System;
11
using C5;
12

    
13
namespace Anagrams {
14
  class MyTest {
15
    public static void Main(String[] args) {
16
      HashedLinkedList<int> test = new HashedLinkedList<int>();
17
      for (int i = 0; i < 33; i++) {
18
        test.Add(i);
19
      } // for
20

    
21
      // Fails after 7 removals
22
      for (int i = 0; i < 33; i++) {
23
        Console.WriteLine(i);
24
        test.Remove(i);
25
      } // for
26

    
27
      // Fails after 23 removals
28
//        for (int i = 32; i >= 0; i--) {
29
//          Console.WriteLine(i);
30
//          test.Remove(i);
31
//        } // for
32
    }
33
  }
34
}