Author: marek
Date: 2007-11-08 10:02:59 -0500 (Thu, 08 Nov 2007)
New Revision: 89194
Added:
trunk/mcs/tests/test-599.cs
Modified:
trunk/mcs/tests/test-77.cs
Log:
2007-11-08 Marek Safar <[EMAIL PROTECTED]>
A test for bug #335594
Added: trunk/mcs/tests/test-599.cs
===================================================================
--- trunk/mcs/tests/test-599.cs 2007-11-08 14:59:21 UTC (rev 89193)
+++ trunk/mcs/tests/test-599.cs 2007-11-08 15:02:59 UTC (rev 89194)
@@ -0,0 +1,50 @@
+using System;
+
+namespace Test
+{
+ using Text = System.Text;
+ using Str = System.String;
+
+ public class String
+ {
+ string s;
+ public String(string s)
+ {
+ this.s=s;
+ }
+
+ public static implicit operator String (string s1)
+ {
+ if(s1==null) return null;
+ return new String(s1);
+ }
+
+ public static implicit operator Str (String s1)
+ {
+ if(s1==null) return null;
+ return s1.ToString();
+ }
+ }
+}
+
+namespace TestCompiler
+{
+ using String=Test.String;
+
+ class MainClass
+ {
+ public static int Main ()
+ {
+ String a = "a";
+ int i=1;
+ a+=i;
+ string s = i + a;
+
+ Console.WriteLine (s);
+ if (s != "1Test.String")
+ return 1;
+
+ return 0;
+ }
+ }
+}
Property changes on: trunk/mcs/tests/test-599.cs
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/mcs/tests/test-77.cs
===================================================================
--- trunk/mcs/tests/test-77.cs 2007-11-08 14:59:21 UTC (rev 89193)
+++ trunk/mcs/tests/test-77.cs 2007-11-08 15:02:59 UTC (rev 89194)
@@ -34,6 +34,12 @@
if ((1 + " " + "hello") != "1 hello")
return 7;
+ const string s1 = null + (string)null;
+ const string s2 = (string)null + null;
+
+ // csc does not compile this one
+ const string s3 = null + null;
+
System.Console.WriteLine ("test ok");
return 0;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches