diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs index 55625b412f48eb..ace5eb7d1d0987 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -341,7 +341,7 @@ public override void BeginExceptFilterBlock() current.MarkFilterAddr(ILOffset); } - public override void BeginCatchBlock(Type exceptionType) + public override void BeginCatchBlock(Type? exceptionType) { if (CurrExcStackCount == 0) throw new NotSupportedException(SR.Argument_NotInExceptionBlock); diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs index 26c1ae27f88ad8..dfcc66d6dcb699 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs @@ -992,7 +992,7 @@ public virtual void BeginExceptFilterBlock() current.MarkFilterAddr(m_length); } - public virtual void BeginCatchBlock(Type exceptionType) + public virtual void BeginCatchBlock(Type? exceptionType) { // Begins a catch block. Emits a branch instruction to the end of the current exception block. diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs index b5e8e0dc0230f9..49190e8c371258 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs @@ -21,7 +21,7 @@ public virtual int ILOffset } } - public virtual void BeginCatchBlock(Type exceptionType) + public virtual void BeginCatchBlock(Type? exceptionType) { } diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs index 321a38f8a069eb..f01cff002fc97c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs @@ -946,7 +946,7 @@ private void EmitCatchStart(CatchBlock cb) // begin the catch, clear the exception, we've // already saved it _ilg.MarkLabel(endFilter); - _ilg.BeginCatchBlock(exceptionType: null!); + _ilg.BeginCatchBlock(exceptionType: null); _ilg.Emit(OpCodes.Pop); } diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs b/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs index 449916fb2a442f..fbcc94202c48b8 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs @@ -17,7 +17,7 @@ public partial class ILGenerator { internal ILGenerator() { } public virtual int ILOffset { get { throw null; } } - public virtual void BeginCatchBlock(System.Type exceptionType) { } + public virtual void BeginCatchBlock(System.Type? exceptionType) { } public virtual void BeginExceptFilterBlock() { } public virtual System.Reflection.Emit.Label BeginExceptionBlock() { throw null; } public virtual void BeginFaultBlock() { } diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.Mono.cs index 249e596ef1b2ef..c1f4df1d9fab0e 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.Mono.cs @@ -343,7 +343,7 @@ private void InternalEndClause() } } - public virtual void BeginCatchBlock(Type exceptionType) + public virtual void BeginCatchBlock(Type? exceptionType) { if (!InExceptionBlock) throw new NotSupportedException("Not in an exception block");