diff options
author | Marek Safar <marek.safar@gmail.com> | 2007-11-08 18:02:59 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2007-11-08 18:02:59 +0300 |
commit | 0a9d27cd163f38538432bad1f3aa2ba34d95664c (patch) | |
tree | a76d8752c60e12a28edf1af4a67f6bdcd85e1fe3 /mcs/tests/test-599.cs | |
parent | 0e8bc6be10ef05c246fb929dc2e6fb56afd7aa73 (diff) |
2007-11-08 Marek Safar <marek.safar@gmail.com>
A test for bug #335594
svn path=/trunk/mcs/; revision=89194
Diffstat (limited to 'mcs/tests/test-599.cs')
-rw-r--r-- | mcs/tests/test-599.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mcs/tests/test-599.cs b/mcs/tests/test-599.cs new file mode 100644 index 00000000000..034f6d96488 --- /dev/null +++ b/mcs/tests/test-599.cs @@ -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; + } + } +} |