Skip to content

Commit 58b9331

Browse files
committed
Add comments for fields order
1 parent 26d3168 commit 58b9331

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ internal enum TypeKind
1919
internal sealed partial class SymbolType : TypeInfo
2020
{
2121
#region Data Members
22+
#region Fields need to be kept in order
23+
// For Mono runtime its important to keep this declaration order in sync with MonoReflectionSymbolType struct in object-internals.h
2224
internal Type _baseType = null!;
2325
internal TypeKind _typeKind;
2426
internal int _rank; // count of dimension
27+
#endregion
2528
// If LowerBound and UpperBound is equal, that means one element.
2629
// If UpperBound is less than LowerBound, then the size is not specified.
2730
internal int[] _iaLowerBound;

src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ namespace System.Reflection.Emit
1313
*/
1414
internal sealed partial class TypeBuilderInstantiation : TypeInfo
1515
{
16+
#region Fields need to be kept in order
17+
// For Mono runtime its important to keep this declaration order in sync with MonoReflectionGenericClass struct in object-internals.h
1618
private Type _genericType;
1719
private Type[] _typeArguments;
20+
#endregion
1821
private string? _strFullQualName;
1922
internal Hashtable _hashtable;
2023

src/libraries/System.Reflection.Emit/tests/MethodBuilder/MethodBuilderGetILGenerator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ public void LoadArrayTypeInILGeneratedMethod()
121121
Assert.Equal("TestType[]", createdMethod.Invoke(null, null));
122122
}
123123

124-
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotMonoRuntime))]
124+
[Fact]
125+
[ActiveIssue("https://github.com/dotnet/runtime/issues/82257", TestRuntimes.Mono)]
125126
public void LoadByRefTypeInILGeneratedMethod()
126127
{
127128
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Public);

src/mono/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.Mono.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace System.Reflection.Emit
3737
[StructLayout(LayoutKind.Sequential)]
3838
internal partial class SymbolType
3939
{
40-
// _baseType, _typeKind and _rank fields defined in shared SymbolType should kept in sync with MonoReflectionSymbolType in object-internals.h
40+
// Sequence of _baseType, _typeKind and _rank fields should kept in sync with MonoReflectionSymbolType in object-internals.h
4141

4242
internal override Type InternalResolve()
4343
{

src/mono/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.Mono.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace System.Reflection.Emit
4242
[StructLayout(LayoutKind.Sequential)]
4343
internal partial class TypeBuilderInstantiation
4444
{
45-
// _genericType and _typeArguments fields defined in shared TypeBuilderInstantiation should kept in sync with MonoReflectionGenericClass in object-internals.h
45+
// Sequence of _genericType and _typeArguments fields should kept in sync with MonoReflectionGenericClass in object-internals.h
4646

4747
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2055:UnrecognizedReflectionPattern",
4848
Justification = "Reflection.Emit is not subject to trimming")]

0 commit comments

Comments
 (0)