diff options
author | Raja R Harinath <harinath@hurrynot.org> | 2005-08-23 17:59:43 +0400 |
---|---|---|
committer | Raja R Harinath <harinath@hurrynot.org> | 2005-08-23 17:59:43 +0400 |
commit | 8ed96f8acd80753116fce38a527cb0e0b46fe94d (patch) | |
tree | 4469b56a46b622c594a709d363d1c88ccc9cd2b4 /mcs/tests/test-439.cs | |
parent | ca67687dbb7d0fd06082ab29f338e6801c8aabbf (diff) |
In mcs:
Fix #75862.
* expression.cs (Unary.ResolveOperator): Don't discard implicit
converted value in Operator.OnesComplement.
In tests:
* test-439.cs: New test from #75862.
svn path=/trunk/mcs/; revision=48725
Diffstat (limited to 'mcs/tests/test-439.cs')
-rw-r--r-- | mcs/tests/test-439.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mcs/tests/test-439.cs b/mcs/tests/test-439.cs new file mode 100644 index 00000000000..85c349c9eff --- /dev/null +++ b/mcs/tests/test-439.cs @@ -0,0 +1,23 @@ +using System; +public struct LayerMask +{ + private ushort mask; + public static implicit operator int (LayerMask mask) { return (int)mask.mask; } + public static implicit operator LayerMask (int intVal) + { + LayerMask mask; + mask.mask = unchecked ((ushort)intVal); + return mask; + } +} + +class Test +{ + static private LayerMask test; + static public void Main () + { + LayerMask a = ~test; + if (a != 0xFFFF) // LayerMask is an ushort internally + throw new Exception (""); + } +} |