@@ -590,9 +590,7 @@ struct MyOtherStruct
590
590
}};
591
591
" ;
592
592
593
- var expectedOutputContents = $@ "using System;
594
- using System.Diagnostics.CodeAnalysis;
595
- using System.Runtime.InteropServices;
593
+ var expectedOutputContents = $@ "using System.Runtime.CompilerServices;
596
594
597
595
namespace ClangSharp.Test
598
596
{{
@@ -606,23 +604,10 @@ public partial struct MyOtherStruct
606
604
[NativeTypeName(""MyStruct[3]"")]
607
605
public _c_e__FixedBuffer c;
608
606
607
+ [InlineArray(3)]
609
608
public partial struct _c_e__FixedBuffer
610
609
{{
611
610
public MyStruct e0;
612
- public MyStruct e1;
613
- public MyStruct e2;
614
-
615
- [UnscopedRef]
616
- public ref MyStruct this[int index]
617
- {{
618
- get
619
- {{
620
- return ref AsSpan()[index];
621
- }}
622
- }}
623
-
624
- [UnscopedRef]
625
- public Span<MyStruct> AsSpan() => MemoryMarshal.CreateSpan(ref e0, 3);
626
611
}}
627
612
}}
628
613
}}
@@ -644,9 +629,7 @@ struct MyOtherStruct
644
629
}};
645
630
" ;
646
631
647
- var expectedOutputContents = $@ "using System;
648
- using System.Diagnostics.CodeAnalysis;
649
- using System.Runtime.InteropServices;
632
+ var expectedOutputContents = $@ "using System.Runtime.CompilerServices;
650
633
651
634
namespace ClangSharp.Test
652
635
{{
@@ -660,55 +643,10 @@ public partial struct MyOtherStruct
660
643
[NativeTypeName(""MyStruct[2][1][3][4]"")]
661
644
public _c_e__FixedBuffer c;
662
645
646
+ [InlineArray(2 * 1 * 3 * 4)]
663
647
public partial struct _c_e__FixedBuffer
664
648
{{
665
649
public MyStruct e0_0_0_0;
666
- public MyStruct e1_0_0_0;
667
-
668
- public MyStruct e0_0_1_0;
669
- public MyStruct e1_0_1_0;
670
-
671
- public MyStruct e0_0_2_0;
672
- public MyStruct e1_0_2_0;
673
-
674
- public MyStruct e0_0_0_1;
675
- public MyStruct e1_0_0_1;
676
-
677
- public MyStruct e0_0_1_1;
678
- public MyStruct e1_0_1_1;
679
-
680
- public MyStruct e0_0_2_1;
681
- public MyStruct e1_0_2_1;
682
-
683
- public MyStruct e0_0_0_2;
684
- public MyStruct e1_0_0_2;
685
-
686
- public MyStruct e0_0_1_2;
687
- public MyStruct e1_0_1_2;
688
-
689
- public MyStruct e0_0_2_2;
690
- public MyStruct e1_0_2_2;
691
-
692
- public MyStruct e0_0_0_3;
693
- public MyStruct e1_0_0_3;
694
-
695
- public MyStruct e0_0_1_3;
696
- public MyStruct e1_0_1_3;
697
-
698
- public MyStruct e0_0_2_3;
699
- public MyStruct e1_0_2_3;
700
-
701
- [UnscopedRef]
702
- public ref MyStruct this[int index]
703
- {{
704
- get
705
- {{
706
- return ref AsSpan()[index];
707
- }}
708
- }}
709
-
710
- [UnscopedRef]
711
- public Span<MyStruct> AsSpan() => MemoryMarshal.CreateSpan(ref e0_0_0_0, 24);
712
650
}}
713
651
}}
714
652
}}
@@ -732,9 +670,7 @@ struct MyOtherStruct
732
670
}};
733
671
" ;
734
672
735
- var expectedOutputContents = $@ "using System;
736
- using System.Diagnostics.CodeAnalysis;
737
- using System.Runtime.InteropServices;
673
+ var expectedOutputContents = $@ "using System.Runtime.CompilerServices;
738
674
739
675
namespace ClangSharp.Test
740
676
{{
@@ -748,23 +684,10 @@ public partial struct MyOtherStruct
748
684
[NativeTypeName(""MyBuffer"")]
749
685
public _c_e__FixedBuffer c;
750
686
687
+ [InlineArray(3)]
751
688
public partial struct _c_e__FixedBuffer
752
689
{{
753
690
public MyStruct e0;
754
- public MyStruct e1;
755
- public MyStruct e2;
756
-
757
- [UnscopedRef]
758
- public ref MyStruct this[int index]
759
- {{
760
- get
761
- {{
762
- return ref AsSpan()[index];
763
- }}
764
- }}
765
-
766
- [UnscopedRef]
767
- public Span<MyStruct> AsSpan() => MemoryMarshal.CreateSpan(ref e0, 3);
768
691
}}
769
692
}}
770
693
}}
@@ -786,9 +709,7 @@ struct MyOtherStruct
786
709
}};
787
710
" ;
788
711
789
- var expectedOutputContents = $@ "using System;
790
- using System.Diagnostics.CodeAnalysis;
791
- using System.Runtime.InteropServices;
712
+ var expectedOutputContents = $@ "using System.Runtime.CompilerServices;
792
713
793
714
namespace ClangSharp.Test
794
715
{{
@@ -803,23 +724,10 @@ public partial struct MyOtherStruct
803
724
[NativeTypeName(""MyStruct[3]"")]
804
725
public _c_e__FixedBuffer c;
805
726
727
+ [InlineArray(3)]
806
728
public partial struct _c_e__FixedBuffer
807
729
{{
808
730
public MyStruct e0;
809
- public MyStruct e1;
810
- public MyStruct e2;
811
-
812
- [UnscopedRef]
813
- public ref MyStruct this[int index]
814
- {{
815
- get
816
- {{
817
- return ref AsSpan()[index];
818
- }}
819
- }}
820
-
821
- [UnscopedRef]
822
- public Span<MyStruct> AsSpan() => MemoryMarshal.CreateSpan(ref e0, 3);
823
731
}}
824
732
}}
825
733
}}
@@ -1135,6 +1043,7 @@ struct MyStruct
1135
1043
1136
1044
var expectedOutputContents = $@ "using System;
1137
1045
using System.Diagnostics.CodeAnalysis;
1046
+ using System.Runtime.CompilerServices;
1138
1047
using System.Runtime.InteropServices;
1139
1048
1140
1049
namespace ClangSharp.Test
@@ -1273,24 +1182,10 @@ public partial struct _Anonymous2_e__Union
1273
1182
public { expectedManagedType } value2;
1274
1183
}}
1275
1184
1185
+ [InlineArray(4)]
1276
1186
public partial struct _buffer2_e__FixedBuffer
1277
1187
{{
1278
1188
public MyUnion e0;
1279
- public MyUnion e1;
1280
- public MyUnion e2;
1281
- public MyUnion e3;
1282
-
1283
- [UnscopedRef]
1284
- public ref MyUnion this[int index]
1285
- {{
1286
- get
1287
- {{
1288
- return ref AsSpan()[index];
1289
- }}
1290
- }}
1291
-
1292
- [UnscopedRef]
1293
- public Span<MyUnion> AsSpan() => MemoryMarshal.CreateSpan(ref e0, 4);
1294
1189
}}
1295
1190
}}
1296
1191
}}
0 commit comments