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

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Apr 1, 2021

Discovered by failing tests in NativeAOT FI (dotnet/runtimelab#898)

@@ -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.

@@ -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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants