New test.
authorMartin Baulig <martin@novell.com>
Mon, 28 Jul 2003 17:29:29 +0000 (17:29 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 28 Jul 2003 17:29:29 +0000 (17:29 -0000)
svn path=/trunk/mcs/; revision=16777

mcs/tests/Makefile
mcs/tests/README.tests
mcs/tests/test-211.cs [new file with mode: 0644]

index df937638e14bc2545624a3b02a3ade79137aabd7..4452700bf7ddc1f5880f4bfe0e8289d3bafc2c5e 100644 (file)
@@ -37,7 +37,8 @@ TEST_SOURCES = \
                 test-172 test-173 test-174 test-175 test-176 test-177 test-178 test-179 test-180 \
        test-181 test-182 test-183 test-184 test-185 test-186 test-187 test-188          test-190 \
        test-191 test-192 test-193 test-194 test-195 test-196 test-197 test-198 test-199 test-200 \
-       test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210
+       test-201 test-202 test-203 test-204 test-205 test-206 test-207 test-208 test-209 test-210 \
+       test-211
 
 
 UNSAFE_SOURCES = \
index a40f22e8e3237562c63ff5b605d9c792804bb211..bac6b8941b4742c19ac6fa35a6b11658e85b1544 100644 (file)
@@ -35,7 +35,7 @@ Test cases listed by Category:
 
 * Invocation and Casts
 
-  test-153.cs test-163.c test-207.cs test-210.cs
+  test-153.cs test-163.c test-207.cs test-210.cs test-211.cs
 
 * Flow Analysis
 
@@ -350,6 +350,11 @@ test-210.cs
 
 Cast something to a delegate and then invoke it; bug #46923.
 
+test-211.cs
+-----------
+
+Multiple casts.
+
 verify-1.cs
 -----------
 Test whether we do not jump out of the method in a Try/Finally block.
diff --git a/mcs/tests/test-211.cs b/mcs/tests/test-211.cs
new file mode 100644 (file)
index 0000000..f5942c4
--- /dev/null
@@ -0,0 +1,51 @@
+class X
+{
+       public readonly int value;
+
+       public X (int value)
+       {
+               this.value = value;
+       }
+
+       public static implicit operator X (int y)
+       {
+               return new X (y);
+       }
+}
+
+class Y
+{
+       public readonly X x;
+
+       public Y (X x)
+       {
+               this.x = x;
+       }
+
+       public static implicit operator Y (X x)
+       {
+               return new Y (x);
+       }
+}
+
+class Z
+{
+       public readonly Y y;
+
+       public Z (Y y)
+       {
+               this.y = y;
+       }
+
+       public static implicit operator Z (Y y)
+       {
+               return new Z (y);
+       }
+
+       public static int Main ()
+       {
+               int a = 5;
+               Y y = (Y) (X) a;
+               return 0;
+       }
+}