Skip to content

Commit a16ce6e

Browse files
committed
Fix API compat failures
1 parent 039a89a commit a16ce6e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeEnumBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected override FieldBuilder DefineLiteralCore(string literalName, object? li
3838
return fieldBuilder;
3939
}
4040

41-
[return: DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.All)]
41+
[return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]
4242
protected override TypeInfo CreateTypeInfoCore()
4343
{
4444
return m_typeBuilder.CreateTypeInfo();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
136136
public abstract int GetTypeMetadataToken(Type type);
137137
public abstract int GetFieldMetadataToken(FieldInfo field);
138138
public abstract int GetMethodMetadataToken(MethodInfo method);
139-
public abstract int GetMethodMetadataToken(ConstructorInfo contsuctor);
139+
public abstract int GetMethodMetadataToken(ConstructorInfo constructor);
140140
public abstract int GetSignatureMetadataToken(SignatureHelper signature);
141141
public abstract int GetStringMetadataToken(string stringConstant);
142142
}

src/libraries/System.Reflection.Emit/ref/System.Reflection.Emit.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ protected EnumBuilder() { }
123123
public System.Type CreateType() { throw null; }
124124
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
125125
public System.Reflection.TypeInfo CreateTypeInfo() { throw null; }
126+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
126127
protected abstract System.Reflection.TypeInfo CreateTypeInfoCore();
127128
public System.Reflection.Emit.FieldBuilder DefineLiteral(string literalName, object? literalValue) { throw null; }
128129
protected abstract System.Reflection.Emit.FieldBuilder DefineLiteralCore(string literalName, object? literalValue);
@@ -416,6 +417,7 @@ public void CreateGlobalFunctions() { }
416417
public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet) { throw null; }
417418
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("P/Invoke marshalling may dynamically access members that could be trimmed.")]
418419
public System.Reflection.Emit.MethodBuilder DefinePInvokeMethod(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet) { throw null; }
420+
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("P/Invoke marshalling may dynamically access members that could be trimmed.")]
419421
protected abstract System.Reflection.Emit.MethodBuilder DefinePInvokeMethodCore(string name, string dllName, string entryName, System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type? returnType, System.Type[]? parameterTypes, System.Runtime.InteropServices.CallingConvention nativeCallConv, System.Runtime.InteropServices.CharSet nativeCharSet);
420422
public System.Reflection.Emit.TypeBuilder DefineType(string name) { throw null; }
421423
public System.Reflection.Emit.TypeBuilder DefineType(string name, System.Reflection.TypeAttributes attr) { throw null; }
@@ -542,6 +544,7 @@ protected TypeBuilder() { }
542544
protected abstract System.Reflection.Emit.PackingSize PackingSizeCore { get; }
543545
public override System.Type? ReflectedType { get { throw null; } }
544546
public int Size { get { throw null; } }
547+
protected abstract int SizeCore { get; }
545548
public override System.RuntimeTypeHandle TypeHandle { get { throw null; } }
546549
public override System.Type UnderlyingSystemType { get { throw null; } }
547550
public void AddInterfaceImplementation([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type interfaceType) { }
@@ -550,6 +553,7 @@ public void AddInterfaceImplementation([System.Diagnostics.CodeAnalysis.Dynamica
550553
public System.Type CreateType() { throw null; }
551554
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
552555
public System.Reflection.TypeInfo CreateTypeInfo() { throw null; }
556+
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
553557
protected abstract System.Reflection.TypeInfo CreateTypeInfoCore();
554558
public System.Reflection.Emit.ConstructorBuilder DefineConstructor(System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type[]? parameterTypes) { throw null; }
555559
public System.Reflection.Emit.ConstructorBuilder DefineConstructor(System.Reflection.MethodAttributes attributes, System.Reflection.CallingConventions callingConvention, System.Type[]? parameterTypes, System.Type[][]? requiredCustomModifiers, System.Type[][]? optionalCustomModifiers) { throw null; }

0 commit comments

Comments
 (0)