Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default nothrow behavior for MethodIL.GetObject #50539

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static ResolutionFailure GetAssemblyResolutionFailure(string simpleName)

public void Throw()
{
switch(_failureType)
switch (_failureType)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file gets compiled in NativeAOT branch with some more stylecop rules.

{
case FailureType.TypeLoadException1:
ThrowHelper.ThrowTypeLoadException(_name, _module);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/Common/TypeSystem/IL/MethodIL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public abstract partial class MethodIL
/// (typically a <see cref="MethodDesc"/>, <see cref="FieldDesc"/>, <see cref="TypeDesc"/>,
/// or <see cref="MethodSignature"/>).
/// </summary>
public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.ReturnNull);
public abstract Object GetObject(int token, NotFoundBehavior notFoundBehavior = NotFoundBehavior.Throw);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is inconsistent with the default for EcmaMethodIL.GetObject and with the original behavior.


/// <summary>
/// Gets a list of exception regions this method body defines.
Expand Down