New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[runtime] Disallow casts between int[] and IList<int?> etc. #6486
Conversation
Does:
Still work? .NET seems to suggest it should: https://sharplab.io/#v2:EYLgtghgzgLgpgJwDQxAgrgOwD4AEAMABLgIwDcAsAFAHEkAslV1uAzMQEyEDChA3tUJDi7UgDZi9OgA4AFAEp+g4SoD2wAFZwAxjEIQECQgF5CmOAHdCAS0wwA/IQDaJfAF0mKldYBmhWQZG1lCEAJIAMsEwADy2DgB8igJUXql0AJyyAEQAHgCeAF5Z8p5pAL7KQhVUZUA |
build |
@@ -8411,13 +8411,15 @@ mono_class_is_assignable_from (MonoClass *klass, MonoClass *oklass) | |||
|
|||
// If the target we're trying to cast to is a valuetype, we must account of weird valuetype equivalences such as IntEnum <> int or uint <> int | |||
// We can't apply it for ref types as this would go wrong with arrays - IList<byte[]> would have byte tested | |||
if (iface_klass->valuetype) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that comment above should be moved into the if
block imho
Please backport to 2017-12 |
@monojenkins build Linux AArch64 |
@monojenkins build Linux AArch64 Interpreter |
@monojenkins build Linux i386 |
@monojenkins build Linux x64 FullAOT |
@monojenkins build Linux ARMv7 hard float interpreter |
Fixes #6401