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:
authorMarek Safar <marek.safar@gmail.com>2014-05-05 16:56:41 +0400
committerMarek Safar <marek.safar@gmail.com>2014-05-05 16:57:57 +0400
commit34241c020f52e47f75fbb2a733d7d9fdb14383b3 (patch)
treee0b96dc983235bea35dfe1c3cfa458d440037ed5 /mcs/tests/test-889.cs
parentd518bd927ab3d0905f65180e8af68baa152a5a95 (diff)
[mcs] Convert extended underlying enum constants to their underlying type. Fixes #18866
Diffstat (limited to 'mcs/tests/test-889.cs')
-rw-r--r--mcs/tests/test-889.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/mcs/tests/test-889.cs b/mcs/tests/test-889.cs
new file mode 100644
index 00000000000..0ba66e45208
--- /dev/null
+++ b/mcs/tests/test-889.cs
@@ -0,0 +1,31 @@
+class Test
+{
+ public enum Ebyte : byte
+ {
+ Mask = 1
+ }
+
+ public enum Esbyte : sbyte
+ {
+ Mask = -127
+ }
+
+ public enum Eshort : short
+ {
+ Mask = 1
+ }
+
+ public enum Eushort : ushort
+ {
+ Mask = 1
+ }
+
+ static void Main ()
+ {
+ byte v1 = (byte)(~Ebyte.Mask);
+ sbyte v2 = (sbyte)(~Esbyte.Mask);
+
+ short v3 = (short)(~Eshort.Mask);
+ ushort v4 = (ushort)(~Eushort.Mask);
+ }
+} \ No newline at end of file