[runtime] Unboxing of nullable enums should throw for boxed ints. (#6958)
commit8d19e5a1c59ef9530fc0b3baf41013c6a6218b9b
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Wed, 14 Feb 2018 16:58:15 +0000 (14 11:58 -0500)
committerMarek Safar <marek.safar@gmail.com>
Wed, 14 Feb 2018 16:58:15 +0000 (14 17:58 +0100)
tree397b4bd756352245ce412f1ee389f5851a3c24bd
parent8f35227b88622dddf3cecd60994cefe182618188
[runtime] Unboxing of nullable enums should throw for boxed ints. (#6958)

* [runtime] Unboxing of nullable enums should throw for boxed ints. Fixes gh #6666.

For some reason, one can't unbox the underlying type of an enum into a nullable.

This is counter intuitive to the unboxing rules of enums, but it's what dotnet does.

* [interp] Unboxing of nullable enmus should throw for boxed ints

fixes https://github.com/mono/mono/issues/6666 for the interpreter
mcs/class/corlib/LinkerDescriptor/mscorlib.xml
mcs/class/corlib/System/Nullable.cs
mono/mini/interp/transform.c
mono/mini/method-to-ir.c
mono/mini/objects.cs