Skip to content

Commit d534c22

Browse files
authored
Fix default nothrow behavior for MethodIL.GetObject (#50539)
1 parent c46b05a commit d534c22

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static ResolutionFailure GetAssemblyResolutionFailure(string simpleName)
8484

8585
public void Throw()
8686
{
87-
switch(_failureType)
87+
switch (_failureType)
8888
{
8989
case FailureType.TypeLoadException1:
9090
ThrowHelper.ThrowTypeLoadException(_name, _module);

src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public abstract partial class MethodIL
8686
/// (typically a <see cref="MethodDesc"/>, <see cref="FieldDesc"/>, <see cref="TypeDesc"/>,
8787
/// or <see cref="MethodSignature"/>).
8888
/// </summary>
89-
public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.ReturnNull);
89+
public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
9090

9191
/// <summary>
9292
/// Gets a list of exception regions this method body defines.

0 commit comments

Comments
 (0)