File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -9837,6 +9837,11 @@ get_virtual_stelemref_kind (MonoClass *element_class)
9837
9837
return STELEMREF_OBJECT ;
9838
9838
if (is_monomorphic_array (element_class ))
9839
9839
return STELEMREF_SEALED_CLASS ;
9840
+
9841
+ /* magic ifaces requires aditional checks for when the element type is an array */
9842
+ if (MONO_CLASS_IS_INTERFACE (element_class ) && element_class -> is_array_special_interface )
9843
+ return STELEMREF_COMPLEX ;
9844
+
9840
9845
/* Compressed interface bitmaps require code that is quite complex, so don't optimize for it. */
9841
9846
if (MONO_CLASS_IS_INTERFACE (element_class ) && !mono_class_has_variant_generic_params (element_class ))
9842
9847
#ifdef COMPRESSED_INTERFACE_BITMAP
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Text ;
3
3
using System . Reflection ;
4
+ using System . Collections . Generic ;
4
5
using System . Runtime . InteropServices ;
5
6
using System . Runtime . CompilerServices ;
6
7
@@ -1829,6 +1830,30 @@ public static int test_0_typedref () {
1829
1830
1830
1831
return 0 ;
1831
1832
}
1833
+
1834
+ public interface IFoo
1835
+ {
1836
+ int MyInt { get ; }
1837
+ }
1838
+
1839
+ public class IFooImpl : IFoo
1840
+ {
1841
+ public int MyInt => 0 ;
1842
+ }
1843
+
1844
+ //gh 6266
1845
+ public static int test_0_store_to_magic_iface_array ( )
1846
+ {
1847
+ ICollection < IFoo > arr1 = new IFooImpl [ 1 ] { new IFooImpl ( ) } ;
1848
+ ICollection < IFoo > arr2 = new IFooImpl [ 1 ] { new IFooImpl ( ) } ;
1849
+
1850
+ ICollection < IFoo > [ ] a2d = new ICollection < IFoo > [ 2 ] {
1851
+ arr1 ,
1852
+ arr2 ,
1853
+ } ;
1854
+
1855
+ return 0 ;
1856
+ }
1832
1857
}
1833
1858
1834
1859
#if __MOBILE__
You can’t perform that action at this time.
0 commit comments