diff options
author | Miguel de Icaza <miguel@gnome.org> | 2002-02-26 20:11:14 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2002-02-26 20:11:14 +0300 |
commit | 7484df02a7465218a6639d8579d8516310aa9ad0 (patch) | |
tree | 3bc31bdce3829cfea907dc39854a4cf69d63195a /mcs/tests/test-77.cs | |
parent | 9fa4a265511c75a76f7a251de26ead32e57110f3 (diff) |
2002-02-26 Miguel de Icaza <miguel@ximian.com>
* cs-parser.jay (if_statement): Rewrote so that we can track the
location for the if statement.
* expression.cs (Binary.ConstantFold): Only concat strings when
the operation is "+", not everything ;-)
* statement.cs (Statement.EmitBoolExpression): Take a location
argument.
(If, While, Do): Track location.
* expression.cs (Binary.ResolveOperator): In the object + string
case, I was missing a call to ConvertImplicit
svn path=/trunk/mcs/; revision=2684
Diffstat (limited to 'mcs/tests/test-77.cs')
-rwxr-xr-x | mcs/tests/test-77.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mcs/tests/test-77.cs b/mcs/tests/test-77.cs new file mode 100755 index 00000000000..aca2001a39e --- /dev/null +++ b/mcs/tests/test-77.cs @@ -0,0 +1,38 @@ +// +// Tests the various string implicit conversions +// + +class XX { + + enum X { + A = 1 + } + + static int Main () + { + int one = 1; + int two = 2; + + if (("a" + "b") != "ab") + return 1; + + if (("one" + one) != "one1") + return 2; + + if ((one + "one") != "1one") + return 3; + + if ((one + "two" + two) != "1two2") + return 4; + + if ((X.A + "a") != "Aa") + return 5; + + if (((int)X.A) + "a" != "1a") + return 6; + + System.Console.WriteLine ("test ok"); + return 0; + } +} + |