blob: 873006592dfa8184cc2d89a318715d5d56537ab5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
//############################################################################
// Bugs
//############################################################################
// $Id$
//############################################################################
// Bug 135
object Bug135Test {
import scala.collection.immutable.TreeMap;
import scala.collection.immutable.Order;
def main(args: Array[String]): Unit = {
val intOrder =
new Order((x:int,y:int) => x < y, (x:int,y:int) => x == y);
val myMap:TreeMap[int,String] = new TreeMap(intOrder);
val map1 = myMap + 42 -> "The answer";
if (map1.get(42) != Some("The answer"))
Console.println("KO: " + map1.get(42));
}
}
//############################################################################
// Bug 167
class Bug167Node(bar:Int) {
val foo = {
val bar = 1;
bar
}
}
object Bug167Test {
def main(args: Array[String]): Unit = {
if (new Bug167Node(0).foo != 1) System.out.println("bug 167");
}
}
//############################################################################
// Bug 168
class Bug168Foo {
class Bar;
def foo = new Bar;
}
object Bug168Test {
def main(args: Array[String]): Unit = {
(new Bug168Foo).foo;
()
}
}
//############################################################################
// Main
object Test {
def main(args: Array[String]): Unit = {
Bug135Test.main(args);
Bug167Test.main(args);
Bug168Test.main(args);
}
}
//############################################################################
|