From fcaa3cfd24076df71c7573beb2ecd0bc256d4028 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Wed, 31 Mar 2021 21:48:05 -0700 Subject: [PATCH] Fix default nothrow behavior for MethodIL.GetObject --- src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs | 2 +- src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs b/src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs index 04d75a5e5ae9c..882537e27f73f 100644 --- a/src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs +++ b/src/coreclr/tools/Common/TypeSystem/Common/ResolutionFailure.cs @@ -84,7 +84,7 @@ public static ResolutionFailure GetAssemblyResolutionFailure(string simpleName) public void Throw() { - switch(_failureType) + switch (_failureType) { case FailureType.TypeLoadException1: ThrowHelper.ThrowTypeLoadException(_name, _module); diff --git a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs index b5eb21fcba429..cfe1f93998b08 100644 --- a/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs +++ b/src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs @@ -86,7 +86,7 @@ public abstract partial class MethodIL /// (typically a , , , /// or ). /// - public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.ReturnNull); + public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw); /// /// Gets a list of exception regions this method body defines.