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:
authorRaja R Harinath <harinath@hurrynot.org>2006-06-02 17:37:45 +0400
committerRaja R Harinath <harinath@hurrynot.org>2006-06-02 17:37:45 +0400
commit395042796a5d72626fbc9a5f3ce28bcacf60c5d9 (patch)
treeb40f0b31b374420e6541ab90c8ceb21918f5b595 /mcs/tests/test-520.cs
parentc4faf6cc6b0c94bd70d7434d3e7011ea207267a6 (diff)
Fix #78079
* mcs/expression.cs (Binary.DoNumericPromotions): Remove and rewrite. (Binary.OverloadResolve_PredefinedIntegral): New. (Binary.OverloadResolve_PredefinedFloating): New. (Binary.OverloadResolve_PredefinedString): New. (Binary.ResolveOperator): Use those instead of DoNumericPromotions. Follow the standard more closely, and treat numeric promotions in terms of overload resolution. (Binary.CheckShiftArguments): Simplify. * gmcs/expression.cs: Likewise. * tests/test-520.cs: New test from #78079. svn path=/trunk/mcs/; revision=61405
Diffstat (limited to 'mcs/tests/test-520.cs')
-rw-r--r--mcs/tests/test-520.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/mcs/tests/test-520.cs b/mcs/tests/test-520.cs
new file mode 100644
index 00000000000..831f200e669
--- /dev/null
+++ b/mcs/tests/test-520.cs
@@ -0,0 +1,15 @@
+using System;
+
+class FakeInt {
+ private long _value;
+ public FakeInt (long val) { _value = val; }
+ public static implicit operator long (FakeInt self) { return self._value; }
+}
+
+class MainClass {
+ public static void Main ()
+ {
+ if(new FakeInt (42) != 42)
+ throw new Exception ();
+ }
+}