Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2005-08-24 00:00:03 +0400
committerAtsushi Eno <atsushieno@gmail.com>2005-08-24 00:00:03 +0400
commitbc48da84e10323f8eb633cb99ed3780eb50ec661 (patch)
treeb4710284e26bd1bdd0219df5ee367f9bd5b7c54c /mcs/tests/test-440.cs
parentb94bcf5be636744210deb284c5fab3bf17f61f4a (diff)
2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
in mcs: * expression.cs : in DoNumericPromotions(), check if there is implicit conversion overload for string (to check CS0034). Fixed bug #52492. in tests: * test-440.cs : non-CS0034 case (overload for double and int is valid). in errors: * cs0034-2.cs : for bug #52492. svn path=/trunk/mcs/; revision=48759
Diffstat (limited to 'mcs/tests/test-440.cs')
-rw-r--r--mcs/tests/test-440.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/mcs/tests/test-440.cs b/mcs/tests/test-440.cs
new file mode 100644
index 00000000000..d8fe33765c3
--- /dev/null
+++ b/mcs/tests/test-440.cs
@@ -0,0 +1,19 @@
+public class A {
+ public static implicit operator double (A a)
+ {
+ return 0.5;
+ }
+
+ // unlike CS0034 case, two or more implicit conversion on other
+ // than string is still valid.
+ public static implicit operator int (A a)
+ {
+ return 0;
+ }
+
+ public static void Main ()
+ {
+ A a = new A ();
+ object p = a + a;
+ }
+}