Skip to content

Commit

Permalink
Fix nullability annotation of ILGenerator.BeginCatchBlock. (dotnet#…
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis authored Jun 11, 2022
1 parent 7a85d0c commit 1f772af
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public virtual int ILOffset
}
}

public virtual void BeginCatchBlock(Type exceptionType)
public virtual void BeginCatchBlock(Type? exceptionType)
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 1f772af

Please sign in to comment.